A rice leaf disease identification method for an open scene

By combining an adversarial masking mechanism with a dynamic and highly reliable sample library, the robustness and adaptability issues of the rice leaf disease identification model in open farmland scenarios are solved, achieving efficient and stable disease identification results.

CN121482600BActive Publication Date: 2026-05-19ANHUI AGRICULTURAL UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ANHUI AGRICULTURAL UNIVERSITY
Filing Date
2025-11-11
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

Existing technologies lack robustness and domain adaptability in rice leaf disease identification models in open farmland scenarios. They face challenges such as dynamic changes in sample distribution, complex noise interference, and stable learning under label-less conditions, resulting in insufficient identification accuracy and stability.

Method used

By employing an adversarial masking mechanism, a dynamic high-reliability sample library, and a steady-state linear transformation, the model is forced to learn deep features through adversarial attention masking. A dynamic high-reliability sample library is constructed and optimized online to achieve efficient adaptation of the model in open scenarios.

Benefits of technology

It improves the detection accuracy and efficiency of rice leaf disease identification, ensures the stability and rapid adaptability of the model in complex farmland environments, reduces false alarm and false negative rates, and achieves rapid deployment with high accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121482600B_ABST
    Figure CN121482600B_ABST
Patent Text Reader

Abstract

The application discloses a rice leaf disease identification method in an open scene, and relates to the technical field of computer vision, and specifically comprises the following steps: step 1: constructing an image enhancement set based on an adversarial attention mask; step 2: defining an entropy toughness index, and constructing a dynamic high-reliability sample library according to the index; step 3: realizing steady-state linear transformation through dynamic weight distribution; and step 4: combining the optimized pre-training classifier and the linear transformation matrix to form a final rice leaf disease identification model. Through the combination of the adversarial mask, the dynamic high-reliability sample library and the steady-state linear transformation, the application effectively solves the problems of poor robustness and difficult field adaptation of the model in an open farmland environment, and improves the performance of the rice leaf disease identification model in an open scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of computer vision technology, specifically relating to a method for identifying diseases in rice leaves in open scenarios. Background Technology

[0002] With the rapid development of artificial intelligence and computer vision technologies, intelligent identification methods for rice leaf diseases based on deep learning have gradually become a research hotspot. Early research mainly focused on the application of deep convolutional neural networks (CNNs) in image classification and object detection tasks. Researchers typically collect a large number of rice leaf disease images in controlled environments such as laboratories or greenhouses, construct multiple public datasets, and train high-performance models such as ResNet, VGG, and YOLO on these datasets. These models achieve excellent test results on standard datasets and can accurately identify a variety of predefined rice disease types. However, when the models are transferred from idealized training environments to real, complex open farmland scenarios, their performance often declines significantly, revealing a serious lack of generalization. The root cause of this performance degradation lies in the significant differences between laboratory and field environments: natural light intensity and angle change frequently, background components are complex and diverse, and diseased leaves are often intertwined with healthy tissue, weeds, soil, and water stains; at the same time, diseased leaves at different growth stages also exhibit diverse visual characteristics. These factors together cause a significant domain bias, making it difficult for the model to effectively generalize the features learned from the training data to real-world application scenarios.

[0003] To alleviate these problems, researchers have explored solutions from both data and model perspectives. At the data level, common strategies include using data augmentation techniques such as random cropping, rotation, and color perturbation to enhance the diversity of rice leaf disease samples. However, these linear transformations struggle to realistically simulate the complex nonlinear variations in open farmland, offering limited improvement to model robustness. To further enhance the diversity of rice leaf disease samples, some studies have attempted to use Generative Adversarial Networks (GANs) to synthesize realistic rice leaf disease images. While this method alleviates the sample shortage problem to some extent, its network design is complex and training costs are high.

[0004] At the model level, domain adaptation methods are introduced to reduce domain discrepancies by aligning the feature distributions of the source domain (training data) and the target domain (test data). However, these methods typically assume that unlabeled target domain data is available during training, and the effectiveness of feature alignment decreases significantly when the target domain data differs greatly from the source domain, potentially even leading to negative transfer. In contrast, domain generalization methods relax this assumption, using only source domain data for training, aiming to learn robust features that are equally effective in unseen domains. However, in the complex, noisy, and highly interfering environment of open farmland, rice leaf disease images present challenges such as complex backgrounds, similar inter-class features, and significant intra-class differences, leaving considerable room for improvement in the recognition accuracy and stability of existing domain generalization models.

[0005] In recent years, to further improve the generalization ability of models in real-world complex environments, researchers have begun to explore test-time adaptation methods. Unlike traditional domain adaptation methods, test-time adaptation does not require access to target domain data during the training phase. Instead, after model deployment, it dynamically adjusts model parameters or feature distributions based on target domain samples arriving gradually during the testing phase to mitigate the impact of inter-domain differences. This method has strong practical value, especially suitable for open scenarios such as rice leaf disease identification where target domain data cannot be obtained in advance.

[0006] In rice leaf disease identification, adaptive testing time offers a novel approach to migrating models from laboratory to real-world farmland environments. By adaptively updating during the inference phase, the model can progressively correct feature distributions without relying on labels, thereby improving robustness and consistency in identification. However, directly applying adaptive testing time methods to rice leaf disease identification in open farmland scenarios still faces several challenges:

[0007] First, the dynamic changes in sample distribution are significant. Farmland images are significantly affected by changes in time, climate, lighting conditions and shooting angle, and a single adaptation strategy is unlikely to be effective in the long term.

[0008] Second, the noise and background interference are complex. Factors such as blurred lesion boundaries, overlapping leaves, and weed obstruction can easily lead to incorrect updates in the model during the adaptation process.

[0009] Third, stable learning under unlabeled conditions is difficult, and the lack of explicit supervision makes the model prone to catastrophic forgetting or overfitting to the current sample when adapting.

[0010] Fourth, the characteristics of diseases exhibit both differences and similarities. The visual differences between different diseases are subtle, while the morphological changes of the same type of disease at different stages are significant, which further exacerbates the difficulty of the model in making judgments during adaptation.

[0011] Therefore, how to achieve efficient, stable and continuous adaptive testing time in open farmland scenarios that are unlabeled, dynamically changing and highly noisy has become a key problem that urgently needs to be solved in the field of intelligent identification of rice leaf diseases. Summary of the Invention

[0012] The present invention aims to address the shortcomings of the existing technology by providing a method for identifying rice leaf diseases in open scenarios. The method aims to improve the detection accuracy and efficiency of rice leaf disease identification in open scenarios by constructing adversarial masks, dynamic high-reliability sample libraries, and steady-state linear transformations, thereby effectively solving the problems of poor robustness and difficulty in domain adaptation of models in complex real farmland environments.

[0013] This invention provides the following technical solution:

[0014] The present invention provides a method for identifying rice leaf diseases in an open farmland setting, characterized by the following steps:

[0015] Step 1: Obtain an open farmland scene containing Rice leaf image data set of different diseases ,in, express The first in Image of a rice leaf. express The total number of images of rice leaves in the middle reaches of the Yangtze River is 100,000. The disease category label is recorded as , Indicates the first Types of diseases, This indicates the number of types of diseases affecting rice leaves;

[0016] Step 2: Utilize a pre-trained classifier A mask generator composed of a multilayer perceptron. right The process yields an attention map, a mask probability sequence, and an adversarial attention mask. Thus, a pre-trained classifier is constructed. objective function and mask generator objective function ;in, express In the The first mask ratio Enhanced image of rice leaves resistant attention mask, The total number of elements representing the mask ratio;

[0017] Step 3: Freeze the mask generator first. parameters And by minimizing For pre-trained classifiers parameters Train, then freeze parameters And by minimizing right parameters Training is performed to obtain the optimal parameters through alternating training. Mask generator below and optimal parameters Pre-trained classifier ;

[0018] Step 4: Construct a dynamic, highly reliable sample library ,in, Indicates the first A highly reliable sample library of rice leaf diseases:

[0019] Step 5: Based on and Construct optimization goals This is used to train the linear transformation matrix to obtain the transformed prediction classification result and the optimized linear transformation matrix. ;

[0020] Step 6: From the pre-trained classifier and the optimized linear transformation matrix An optimal visual detection model for rice leaf diseases in open scenes was constructed to detect diseases in rice leaf images in open scenes.

[0021] The method for identifying rice leaf diseases in an open farmland setting, as described in this invention, is characterized in that step 2 includes the following steps:

[0022] Step 2.1: [The text appears to be incomplete and contains several grammatical errors. A more accurate translation would require Divided into A number of image blocks of the same size, denoted as ,in, for The Image blocks, express The total number of image blocks;

[0023] Will Each image patch is input with the following parameters: Pre-trained classifier The process involves processing the data from each image patch and concatenating the outputs. attention map ;

[0024] Step 2.2: [The text appears to be incomplete and contains several grammatical errors. A more accurate translation would require Input parameters are mask generator The process is performed to obtain the result using equation (1). The Middle Image blocks Normalized mask probability And thus obtain Mask probability sequence ;

[0025] (1)

[0026] In equation (1), yes The Gumbel noise samples from image patches, For temperature parameters, express The The unnormalized probability of each image patch being masked express The Middle Image blocks Attention value, Represents an exponential function. This represents the stopping gradient;

[0027] Step 2.3: Retain Center front The image block corresponding to the highest mask probability value is selected, and the pixel values ​​of all the remaining unretained image blocks are set to 0, thus obtaining... Corresponding adversarial attention mask ;

[0028] use right After processing, the masked image of the rice leaf is obtained. This results in an image enhancement set for rice leaf diseases based on adversarial attention masks. ,in, express In the The first mask ratio Enhanced image of rice leaves. The number representing the mask ratio, express The total number of enhanced images of rice leaves in medium-grain rice;

[0029] Step 2.4: Input parameters are Pre-trained classifier Thus, a pre-trained classifier can be constructed using equation (2). objective function :

[0030] (2)

[0031] In equation (2), Represents the cross-entropy function. This represents the stopping gradient. For hyperparameters, Entropy;

[0032] Step 2.5: Construct a pre-trained classifier using equation (3) parameters Update formula:

[0033] (3)

[0034] In equation (3), This indicates assignment. Represents a pre-trained classifier The learning rate Represents the loss function right The gradient;

[0035] Step 2.6: Calculate the mask generator using equation (4) objective function :

[0036] (4)

[0037] In equation (4), This represents the desired mask ratio. Indicates hyperparameters;

[0038] Step 2.7: Construct a mask generator using equation (5) parameters Update formula:

[0039] (5)

[0040] In equation (5), Represents generator The learning rate express For parameters The gradient.

[0041] Furthermore, step 4 includes the following steps:

[0042] Step 4.1: Calculate using equation (6) Entropy resilience index value :

[0043] (6)

[0044] In equation (6), express The mean of entropy, Indicates hyperparameters;

[0045] Step 4.2: [The text appears to be incomplete and contains several grammatical errors. A more accurate translation would require the full context.] Input optimal parameters Pre-trained classifier Process it and obtain logits vector and predicted classification results Thus obtain logits output set ,in, Represents a pre-trained classifier Feature extractor in;

[0046] Step 4.3: When At that time, by and composition any sample ;

[0047] Step 4.4: Following the steps in Steps 4.1 and 4.3, continuously add samples to the high-reliability sample bank for different types of rice leaf diseases until the number of samples in the high-reliability sample bank reaches the capacity of the sample bank. until;

[0048] Step 4.5: When Number of samples At that time, determine whether the entropy resilience index value in the new sample is less than If the highest entropy resilience index value is less than a certain threshold, then a new sample is used to replace the sample corresponding to the highest entropy resilience index value; otherwise, no new sample is added. Thus, a dynamic and highly reliable sample library is obtained. ,make The set of logits vectors for all samples in the dataset is: ;

[0049] Step 4.6: Determine whether equation (7) is true. If it is true, proceed to step 5; otherwise, return to step 4.4.

[0050] (7)

[0051] In equation (7), This indicates an indicator function that takes the value 1 if its condition is true, and 0 otherwise. This represents the threshold.

[0052] Furthermore, step 5 includes the following steps:

[0053] Step 5.1: Construct the optimization objective using equation (8) and the linear transformation matrix to be learned Optimization is performed to obtain the optimized linear transformation matrix. :

[0054] (8)

[0055] In equation (8), express The covariance matrix, express The covariance matrix, Let T denote the Frobenius norm, and T denote the transpose.

[0056] Step 5.2: Use equation (9) to... Perform a linear transformation to obtain the set of logits vectors after dynamic hybrid linear transformation. :

[0057] (9)

[0058] In equation (13), and They represent and The mean; These are the hyperparameters to be learned;

[0059] Step 5.3: [The sentence is incomplete and requires more context to be translated accurately.] Input pre-trained classifier The classification header is processed to obtain the predicted classification result after linear transformation. .

[0060] The present invention provides an electronic device, including a memory and a processor, characterized in that the memory is used to store a program that supports the processor in executing the rice leaf disease identification method for open scenarios, and the processor is configured to execute the program stored in the memory.

[0061] The present invention provides a computer-readable storage medium storing a computer program, characterized in that the computer program, when executed by a processor, performs the steps of the method for identifying rice leaf diseases in an open scenario.

[0062] Compared with the prior art, the beneficial effects of the present invention are:

[0063] 1. This invention employs an innovative adversarial attention masking mechanism to proactively and intelligently mask the most prominent discriminative regions in rice leaf images during training. This forces the model to learn deeper, more fundamental intrinsic features of rice leaf diseases, such as subtle textures, shapes, or color gradations, rather than relying solely on surface cues susceptible to ambient light, shadows, or background interference. This makes the trained model highly resilient to the complex and varied conditions of real farmland environments, ensuring stable and reliable detection performance under various harsh conditions and significantly reducing false positive and false negative rates.

[0064] 2. This invention innovatively proposes a dynamic reliable sample library based on the entropy resilience index. This solves the problem of performance degradation caused by differences in environmental and disease characteristics when the model is deployed to a new farmland environment. Its specific functions are as follows: When the model starts working in a new farmland, the mechanism can analyze the currently captured rice leaf images on-site and online, and automatically select high-quality samples whose diagnostic results remain stable when faced with image disturbances. These reliable samples from the new farmland are then used as anchor knowledge to guide the model to fine-tune itself in real time, enabling it to quickly align with and adapt to the actual conditions of the current farmland. This allows the model to quickly and automatically adapt to a completely new working environment, effectively bridging the gap between training data and actual application scenarios. The entire process does not require access to the original training data or expensive and time-consuming global retraining, ensuring that the rice leaf disease identification model can be quickly deployed and maintain high accuracy in different farmland environments, which has significant practical value and economic benefits. Attached Figure Description

[0065] Figure 1 This is a flowchart of the method of the present invention. Detailed Implementation

[0066] This implementation presents a method for identifying rice leaf diseases in open scenarios. Its core idea is to optimize and adjust a pre-trained rice leaf disease identification model online using an online optimization framework constructed from adversarial attention masks, a dynamic high-reliability sample library, and steady-state linear transformations. Specifically, the method includes the following steps:

[0067] In actual implementation, the rice leaf image dataset will be divided into multiple batches. To illustrate the technical solution of this invention in detail, the following steps involve the collection of rice leaf disease image data. For each batch of data, the model is trained on one batch of data at a time, and is gradually optimized through multiple batches. After traversing all batches of data, the optimal model is obtained, which is used to classify unlabeled images in the test domain.

[0068] Step 1: Obtain an open farmland scene containing Rice leaf image data set of different diseases ,in, express The first in Image of a rice leaf. express The total number of images of rice leaves in the middle reaches of the Yangtze River is 100,000. The disease category label is recorded as , Indicates the first Types of diseases, This indicates the number of types of diseases affecting rice leaves;

[0069] Step 2: Utilize a pre-trained classifier A mask generator implemented using a multilayer perceptron. right The process yields an attention map, class prediction probabilities, a mask probability sequence, and a resistant attention mask. Thus, a pre-trained classifier is constructed. objective function and mask generator objective function ;in, express In the The first mask ratio Enhanced image of rice leaves resistant attention mask, The total number of elements representing the mask ratio;

[0070] The core objective of this step is to force the classifier to comply with adversarial data augmentation techniques. Learn more robust features, classifier The goal is to correctly identify images even when they are occluded, while the generator aims to find the occlusion method that most interferes with the classifier. The optimization rule is the objective function. and ,in Used to train classifiers How to resist interference Used to train generators How to create interference more effectively. In this way, the classifier... They are forced to learn to focus on the truly core characteristics of the disease, rather than relying on simple backgrounds or textures.

[0071] Step 2.1: [The text appears to be incomplete and contains several grammatical errors. A more accurate translation would require Divide into image blocks of the same size ,in for The Image blocks, express The total number of image blocks divided into, and Input parameters are Pre-trained classifier The process is performed, and the output is generated accordingly. Corresponding attention map ;

[0072] Step 2.2: [The text appears to be incomplete and contains several grammatical errors. A more accurate translation would require Input parameters are mask generator The process is performed to obtain the result using equation (1). The Middle Image blocks Normalized mask probability And thus obtain Mask probability sequence ;

[0073] (1)

[0074] In equation (1), yes The Gumbel noise samples from image patches, For temperature parameters, express The The unnormalized probability of each image patch being masked express The Middle Image blocks Attention value, Represents an exponential function. This represents the stopping gradient;

[0075] Mask generator Using classifiers The attention map is used to determine how to generate the mask. It will calculate a mask probability for each small patch of the image. In this process, Gumbel noise is introduced to increase the exploratory nature of the training, making... The model doesn't generate the exact same mask every time, which helps it find better masking strategies, while also using stopping gradients. Operation, this ensures Training only affects its own parameters. And it will not affect the classifier in this step. parameters .

[0076] Step 2.3: Retain forward The operation involves selecting the image block corresponding to the highest mask probability value and setting all pixel values ​​of the remaining unretained image blocks to 0. Corresponding adversarial attention mask ,right application Obtain the masked image of the rice leaf This results in an image enhancement set for rice leaf diseases based on adversarial attention masks. ,in, express In the The first mask ratio Enhanced image of rice leaves. The number representing the mask ratio, express The total number of enhanced images of rice leaves in medium-grain rice;

[0077] Step 2.4: Input parameters are Pre-trained classifier Thus, a pre-trained classifier can be constructed using equation (2). objective function :

[0078] (2)

[0079] In equation (2), Represents the cross-entropy function. This represents the stopping gradient. For hyperparameters, Entropy;

[0080] The objective function in this step It contains two key parts: the first requires a classifier. In the obscured image The prediction result should be consistent with the original image. The first term ensures consistent predictions, forcing the model to learn the same information from limited, critical image patches as from the complete image. The second term introduces an entropy adjustment mechanism to promote more certain predictions on the original image, while offering moderate uncertainty for predictions on occluded images, preventing the model from making overconfident and erroneous predictions in cases of missing information.

[0081] Step 2.5: Construct a pre-trained classifier using equation (3) parameters Update formula:

[0082] (3)

[0083] In equation (3), This indicates assignment. Represents a pre-trained classifier The learning rate Represents the loss function right The gradient;

[0084] Step 2.6: Calculate the mask generator using equation (4) objective function :

[0085] (4)

[0086] In equation (4), This represents the desired mask ratio. Indicates hyperparameters;

[0087] The generator in this step aims to optimize the classifier's adaptive loss by generating a mask with maximum perturbation near the current classifier's discrimination boundary. Therefore, the generator's loss function The main components are ,also, It also includes a regularization term to constrain the proportion of the occluded region in the entire image, thus preventing the generator from adopting extreme strategies such as completely occluding or not occluding the image at all. Through this alternating optimization mechanism, the classifier... Anti-interference capability and generator Their interference capabilities can be enhanced synergistically during the confrontation process, forming a gradually converging dynamic equilibrium.

[0088] Step 2.7: Construct a mask generator using equation (5) parameters Update formula:

[0089] (5)

[0090] In equation (5), Represents generator The learning rate express For parameters The gradient;

[0091] Step 3: Freeze the mask generator first. parameters And by minimizing For pre-trained classifiers parameters Train, then freeze parameters And by minimizing right parameters Training is performed to obtain the optimal parameters through alternating training. Mask generator below and optimal parameters Pre-trained classifier ;

[0092] This step describes the specific implementation of alternating training, because... and Since the objectives are mutually exclusive, synchronous optimization is not possible. Therefore, an alternating strategy is adopted. First, the generator parameters are fixed. By minimizing To train classifier parameters ,make Adapt the current masking strategy, and then fix the classifier parameters. By minimizing To train generator parameters ,make In response to the current situation A better mask is generated, and this iterative process is repeated until the model converges, ultimately resulting in a highly robust classifier trained in an adversarial environment. and the optimal generator .

[0093] Step 4: Construct a dynamic, highly reliable sample library ,in, Indicates the first A highly reliable sample library of rice leaf diseases:

[0094] Step 4.1: Calculate using equation (6) Entropy resilience index value :

[0095] (6)

[0096] In equation (6), express The mean of entropy, Indicates hyperparameters;

[0097] This step defines the entropy resilience index value. To identify highly reliable samples from real farmland data that are similar to those in the source domain, this invention innovates the entropy resilience index value. As an evaluation criterion. This value measures the stability of a model's predictions when faced with information disturbances; the lower the value, the higher the reliability of the sample. First, the model's original prediction for the sample demonstrates high certainty, meaning that the predicted distribution entropy value is low when the model is undisturbed, indicating a clear decision boundary and high confidence. Second, when the sample is obscured by an adversarial mask, the entropy value of the predicted result changes only slightly, meaning the variance of the entropy under different masks is low, indicating that the model's discrimination of the sample has strong stability and robustness. Therefore, Samples with lower values ​​represent significant features that can be stably identified by the model, exhibiting high intra-domain consistency and robustness against interference. They can be considered high-quality, reliable samples, providing a reliable structural reference for subsequent adaptive learning.

[0098] Step 4.2: [The text appears to be incomplete and contains several grammatical errors. A more accurate translation would require the full context.] Input optimal parameters Pre-trained classifier Process it and obtain logits vector and predicted classification results Thus obtain logits output set ,in, Represents a pre-trained classifier Feature extractor in;

[0099] Step 4.3: When At that time, by and composition any sample ;

[0100] Step 4.4: Following the steps in Steps 4.1 and 4.3, continuously add samples to the high-reliability sample bank for different types of rice leaf diseases until the number of samples in the high-reliability sample bank reaches the capacity of the sample bank. until;

[0101] Step 4.5: When Number of samples At that time, determine whether the entropy resilience index value in the new sample is less than If the highest entropy resilience index value is less than a certain threshold, then a new sample is used to replace the sample corresponding to the highest entropy resilience index value; otherwise, no new sample is added. Thus, a dynamic and highly reliable sample library is obtained. ,make The set of logits vectors for all samples in the dataset is: ;

[0102] This step utilizes the entropy resilience index value. Build and maintain a dynamic and reliable sample library This memory is a high-quality sample pool with limited capacity, used to store the current collection of rice leaf images. The set of samples with the lowest scores. The memory is initially empty; as the model receives new samples, it calculates their scores. The score is then compared with existing samples in the memory bank. If the new sample's score is higher... If a sample's score is lower than the highest-scoring sample in the memory bank, that sample is replaced, thus ensuring the memory bank remains intact. The minimum sample set is used. The memory capacity is set to a preset upper limit to ensure that only a limited number of high-quality samples are retained and to control computational costs. Through this dynamic update mechanism, the rice leaf images that the model considers most stable and representative are always maintained, providing a robust benchmark for subsequent hybrid linear transformations.

[0103] Step 4.6: Determine whether equation (7) is true. If it is true, proceed to step 5; otherwise, return to step 4.4.

[0104] (7)

[0105] In equation (7), This indicates an indicator function that takes the value 1 if its condition is true, and 0 otherwise. Indicates the threshold;

[0106] Step 5: Based on and Construct optimization goals This is used to train the linear transformation matrix to obtain the transformed prediction classification result and the optimized linear transformation matrix. ;

[0107] The goal of this step is to calibrate the overall feature space. Currently, there are feature distributions from two datasets: one from the complete dataset. The first is the global feature distribution, which may contain noise and outliers; the second is from a highly reliable sample library. The feature distribution is purer and represents ideal intra-class compactness. Our goal is to learn a linear transformation matrix. ,Will global feature space distribution The ideal feature space distribution after transformation Above, this process aims to utilize The global feature space is adjusted as a benchmark in order to compress intra-class variance and increase inter-class distance.

[0108] Step 5.1: Construct the optimization objective using equation (8) and the linear transformation matrix to be learned Optimization is performed to obtain the optimized linear transformation matrix. :

[0109] (8)

[0110] In equation (8), express The covariance matrix, express The covariance matrix, Let T denote the Frobenius norm, and T denote the transpose.

[0111] Step 5.2: Use equation (9) to... Perform a linear transformation to obtain the set of logits vectors after dynamic hybrid linear transformation. :

[0112] (9)

[0113] In equation (13), and They represent and The mean; These are the hyperparameters to be learned;

[0114] After obtaining the optimized alignment matrix Subsequently, directly replacing the original logits vector with the transformed logits vector may cause a drastic shift in the model's representation space. Therefore, this invention introduces a smooth and robust dynamic hybridization strategy to achieve a gradual transformation of the feature space, resulting in a final feature representation... It is composed of two weighted and merged parts: one is the set of vectors after linear transformation. The second is the original set of vectors that have not undergone any transformation. Both are achieved through learnable weight parameters. Perform linear combinations, when When the value is close to 1, the model relies more on the transformation vector; when... When the vector is close to zero, the model tends to retain the original vector. This is achieved through... Through adaptive learning, the model can achieve a dynamic balance between alignment strength and stability, thereby promoting effective feature transfer while maintaining knowledge continuity.

[0115] Step 5.3: [The sentence is incomplete and requires more context to be translated accurately.] Input pre-trained classifier The classification header is processed to obtain the predicted classification result after linear transformation. ;

[0116] Using the transformed vector set To perform the final classification, because Based on a highly reliable sample library After undergoing a linear transformation, the statistical properties of the data exhibit better distribution characteristics; therefore, using... As input to the classification head, it will produce a better result than using the original vector. More accurate and robust classification results.

[0117] Step 6: From the pre-trained classifier and the optimized linear transformation matrix An optimal visual detection model for rice leaf diseases in open scenes was constructed to detect diseases in rice leaf images in open scenes.

[0118] In this embodiment, an electronic device includes a memory and a processor. The memory stores a program that supports the processor in executing the above-described method, and the processor is configured to execute the program stored in the memory.

[0119] In this embodiment, a computer-readable storage medium stores a computer program, which is executed by a processor to perform the steps of the above method.

[0120] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A method for identifying rice leaf diseases in open farmland scenarios, characterized in that, Includes the following steps: Step 1: Obtain an open farmland scene containing Rice leaf image data set of different diseases ,in, express The first in Image of a rice leaf. express The total number of images of rice leaves in China The disease category label is recorded as , Indicates the first Types of diseases, This indicates the number of types of diseases affecting rice leaves; Step 2: Utilize a pre-trained classifier A mask generator composed of a multilayer perceptron. right The process yields an attention map, a mask probability sequence, and an adversarial attention mask. Thus, a pre-trained classifier is constructed. objective function and mask generator objective function ;in, express In the The first mask ratio Enhanced image of rice leaves Adversarial attention mask, The total number of elements representing the mask ratio; Step 3: Freeze the mask generator first. parameters And by minimizing For pre-trained classifiers parameters Train, then freeze parameters And by minimizing right parameters Training is performed to obtain the optimal parameters through alternating training. Mask generator below and optimal parameters Pre-trained classifier ; Step 4: Construct a dynamic, highly reliable sample library ,in, Indicates the first A highly reliable sample library of rice leaf diseases: Step 5: Based on and Construct optimization goals This is used to train the linear transformation matrix to obtain the transformed prediction classification result and the optimized linear transformation matrix. ; Step 6: From the pre-trained classifier and the optimized linear transformation matrix An optimal visual detection model for rice leaf diseases in open scenes was constructed to detect diseases in rice leaf images in open scenes.

2. The method for identifying rice leaf diseases in an open farmland setting according to claim 1, characterized in that, Step 2 includes the following steps: Step 2.1: [The text appears to be incomplete and contains several grammatical errors. A more accurate translation would require the full context.] Divided into A number of image blocks of the same size, denoted as ,in, for The Image blocks, express The total number of image blocks; Will Each image patch is input with the following parameters: Pre-trained classifier The process involves processing the data from each image patch and concatenating the outputs. attention map ; Step 2.2: [The text appears to be incomplete and contains several grammatical errors. A more accurate translation would require the full context.] Input parameters are mask generator The process is performed to obtain the result using equation (1). The Middle Image blocks Normalized mask probability And thus obtain Mask probability sequence ; (1) In equation (1), yes The Gumbel noise samples from image patches, For temperature parameters, express The The unnormalized probability of each image patch being masked express The Middle Image blocks Attention value, Represents an exponential function. This represents the stopping gradient; Step 2.3: Retain Center front The image block corresponding to the highest mask probability value is selected, and the pixel values ​​of all the remaining unretained image blocks are set to 0, thus obtaining... Corresponding adversarial attention mask ; use right After processing, the masked image of the rice leaf is obtained. This results in an image enhancement set for rice leaf diseases based on adversarial attention masks. ,in, express In the The first mask ratio Enhanced image of rice leaves. The total number representing the mask ratio. express The total number of enhanced images of rice leaves in medium-grain rice; Step 2.4: Input parameters are Pre-trained classifier Thus, a pre-trained classifier can be constructed using equation (2). objective function : (2) In equation (2), Represents the cross-entropy function. This represents the stopping gradient. For hyperparameters, Entropy; Step 2.5: Construct a pre-trained classifier using equation (3) parameters Update formula: (3) In equation (3), This indicates assignment. Represents a pre-trained classifier The learning rate Represents the loss function right The gradient; Step 2.6: Calculate the mask generator using equation (4) objective function : (4) In equation (4), This represents the desired mask ratio. Indicates hyperparameters; Step 2.7: Construct a mask generator using equation (5) parameters Update formula: (5) In equation (5), Represents generator The learning rate express For parameters The gradient.

3. The method for identifying rice leaf diseases in an open farmland setting according to claim 2, characterized in that, Step 4 includes the following steps: Step 4.1: Calculate using equation (6) Entropy resilience index value : (6) In equation (6), express The mean of entropy, Indicates hyperparameters; Step 4.2: [The text appears to be incomplete and contains several grammatical errors. A more accurate translation would require the full context.] Input optimal parameters Pre-trained classifier Process it and obtain logits vector and predicted classification results Thus obtain logits output set ,in, Represents a pre-trained classifier Feature extractor in; Step 4.3: When At that time, by and composition any sample ; Step 4.4: Following the steps in Steps 4.1 and 4.3, continuously add samples to the high-reliability sample bank for different types of rice leaf diseases until the number of samples in the high-reliability sample bank reaches the capacity of the sample bank. until; Step 4.5: When Number of samples At that time, determine whether the entropy resilience index value in the new sample is less than If the highest entropy resilience index value is less than a certain threshold, then a new sample is used to replace the sample corresponding to the highest entropy resilience index value; otherwise, no new sample is added. Thus, a dynamic and highly reliable sample library is obtained. ,make The set of logits vectors for all samples in the dataset is: ; Step 4.6: Determine whether equation (7) is true. If it is true, proceed to step 5; otherwise, return to step 4.

4. (7) In equation (7), This indicates an indicator function that takes the value 1 if its condition is true, and 0 otherwise. This represents the threshold.

4. The method for identifying rice leaf diseases in an open farmland setting according to claim 3, characterized in that, Step 5 includes the following steps: Step 5.1: Construct the optimization objective using equation (8) and the linear transformation matrix to be learned Optimization is performed to obtain the optimized linear transformation matrix. : (8) In equation (8), express The covariance matrix, express The covariance matrix, Let T denote the Frobenius norm, and T denote the transpose. Step 5.2: Use equation (9) to... Perform a linear transformation to obtain the set of logits vectors after dynamic hybrid linear transformation. : (9) In equation (9), and They represent and The mean; These are the hyperparameters to be learned; Step 5.3: [The sentence is incomplete and requires more context to be translated accurately.] Input pre-trained classifier The classification header is processed to obtain the predicted classification result after linear transformation. .

5. An electronic device, comprising a memory and a processor, characterized in that, The memory is used to store a program that supports the processor in executing any one of claims 1-4 for the method of identifying rice leaf diseases in an open farmland scenario, and the processor is configured to execute the program stored in the memory.

6. A computer-readable storage medium storing a computer program thereon, characterized in that, The computer program, when run by the processor, executes the steps of the method for identifying rice leaf diseases in an open farmland scenario as described in any one of claims 1-4.