A plant disease feature recognition method and system based on deep learning
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- YANAN UNIV
- Filing Date
- 2026-07-10
- Publication Date
- 2026-08-07
AI Technical Summary
[0004]尽管如此,现有的基于深度学习的技术方案在应对实际农业应用的复杂需求时,仍存在若干深层次的局限性
[0005] To address the aforementioned problems in the existing technology, this invention provides a method and system for identifying plant disease features based on deep learning.
Smart Images

Figure CN122530221A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of deep learning technology, specifically to a method and system for identifying plant disease features based on deep learning. Background Technology
[0002] Rapid and accurate identification of plant diseases is crucial for ensuring agricultural production safety and reducing yield losses. Traditional methods relying on agricultural expert experience or laboratory analysis have inherent limitations, including low efficiency, high subjectivity, and difficulty in large-scale application. With the development of computer vision technology, automatic identification methods based on image processing have emerged. In particular, technologies represented by deep learning have significantly improved identification accuracy through powerful automatic feature extraction capabilities, providing a new technical path for intelligent monitoring of plant diseases. However, actual agricultural applications are characterized by complex and variable field environments, limited computing resources for deployed equipment, and diverse and subtle differences in disease manifestations. Therefore, how to ensure high identification accuracy while meeting the comprehensive requirements of practical deployment for model efficiency, generalization ability, discriminative power for subtle features, and robustness in complex environments has become a core technical challenge in the current process of technology practical application.
[0003] To address these challenges, existing technologies primarily revolve around deep learning models. Specifically, researchers have applied classic convolutional neural network architectures to plant disease image classification and fine-tuned the models using transfer learning strategies, achieving good results on standard datasets. Furthermore, to improve model performance, technical solutions are gradually evolving towards specialization: these include designing lightweight backbone networks to improve efficiency, employing multi-scale feature fusion to adapt to lesions of different sizes, introducing attention mechanisms to focus on key regions, and applying object detection and image segmentation frameworks to achieve precise lesion localization and pixel-level analysis. These deep learning-based technical solutions, in terms of feature representation capabilities, generally surpass early traditional image processing methods based on manually designed features, constituting the closest existing technology to solving the problem of intelligent identification of plant diseases.
[0004] Despite this, existing deep learning-based solutions still have several deep-seated limitations when addressing the complex needs of real-world agricultural applications. First, there is an irreconcilable contradiction between model complexity and inference efficiency. High-precision models typically incur huge computational and storage costs, making efficient deployment on resource-constrained field equipment difficult. Conversely, overly lightweight models often lead to decreased feature extraction capabilities and recognition accuracy. Second, model performance is highly dependent on the distribution of training data. When applied to different regions, varieties, or growing environments, differences in image feature distribution can cause significant performance degradation, revealing inherent limitations in cross-domain generalization. Third, existing models struggle to effectively learn and distinguish fine-grained features, such as early symptoms of different diseases with similar visual characteristics, or progressive morphological changes of the same disease at varying degrees of severity, easily leading to category confusion. Furthermore, in complex field scenarios, facing factors such as uneven lighting, foliage obstruction, and background interference, existing methods still fall short in terms of the accuracy and stability of lesion segmentation and localization, failing to fully meet the demands of high-precision field operations. Summary of the Invention
[0005] To address the aforementioned problems in the existing technology, this invention provides a method and system for identifying plant disease features based on deep learning.
[0006] The technical problem to be solved by this invention is achieved through the following technical solution: In a first aspect, the present invention provides a method for identifying plant disease features based on deep learning, comprising: Acquire images of the plant to be identified; The images of the plants to be identified are preprocessed to obtain standardized image data; Standardized image data is input into a pre-trained plant disease identification model to obtain the final disease identification results; The pre-trained plant disease identification model is trained based on plant image samples and a preset total loss. The preset total loss is composed of cross-entropy loss, binary cross-entropy loss, triplet loss, and Dice coefficient loss. The pre-trained plant disease identification model is equipped with a domain adaptation module and a fine-grained classification module. The domain adaptation module is based on an adversarial learning mechanism and performs domain offset correction through the collaborative work of a feature extractor, a domain classifier, and a domain discriminator with gradient inversion. The fine-grained classification module integrates residual attention and metric learning to distinguish visually similar disease features.
[0007] Secondly, the present invention provides a plant disease feature recognition system based on deep learning, comprising: an acquisition unit, a preprocessing unit, and a recognition unit; The acquisition unit is used to acquire images of the plant to be identified. The preprocessing unit is used to perform preprocessing operations on the plant images to be identified to obtain standardized image data; The recognition unit is used to input standardized image data into a pre-trained plant disease recognition model to obtain the final disease recognition result. The pre-trained plant disease identification model is trained based on plant image samples and a preset total loss. The preset total loss is composed of cross-entropy loss, binary cross-entropy loss, triplet loss, and Dice coefficient loss. The pre-trained plant disease identification model is equipped with a domain adaptation module and a fine-grained classification module. The domain adaptation module is based on an adversarial learning mechanism and performs domain offset correction through the collaborative work of a feature extractor, a domain classifier, and a domain discriminator with gradient inversion. The fine-grained classification module integrates residual attention and metric learning to distinguish visually similar disease features.
[0008] This invention provides a method and system for plant disease feature recognition based on deep learning. The method includes: acquiring images of plants to be identified; preprocessing the plant images to obtain standardized image data; inputting the standardized image data into a pre-trained plant disease recognition model to obtain the final disease recognition result; wherein the pre-trained plant disease recognition model is trained based on plant image samples and a preset total loss; the preset total loss is composed of cross-entropy loss, binary cross-entropy loss, triplet loss, and Dice coefficient loss; the pre-trained plant disease recognition model includes a domain adaptation module and a fine-grained classification module; the domain adaptation module is based on an adversarial learning mechanism, using a feature extractor, a domain classifier, and a domain discriminator with gradient inversion to perform domain offset correction; the fine-grained classification module integrates residual attention and metric learning to distinguish visually similar disease features. In this invention, firstly, by introducing a domain adaptation module and performing domain offset correction based on an adversarial learning mechanism, the cross-domain generalization ability deficiency of pre-trained plant disease identification models caused by differences in training data distribution is solved, significantly mitigating the performance degradation problem when applied in different regions, varieties, or environments. Secondly, by designing a fine-grained classification module that integrates residual attention and metric learning, the problem of distinguishing fine-grained features of visually similar early symptoms of diseases or gradual changes in the severity of the same disease by different fine-grained features in pre-trained plant disease identification models is solved, effectively reducing category confusion. Finally, by combining cross-entropy loss, binary cross-entropy loss, triplet loss, and Dice coefficient loss to form a preset total loss, and coordinating it with the domain adaptation and fine-grained classification modules, the accuracy and stability of lesion segmentation and localization in complex field scenarios such as uneven lighting and shading are enhanced. Simultaneously, by focusing on key features through an attention mechanism and efficient architecture design, the contradiction between the complexity and inference efficiency of the pre-trained plant disease identification model is alleviated. In summary, this invention achieves a comprehensive improvement in the accuracy, robustness, efficiency, and adaptability of plant disease identification, and can better meet the complex needs of practical agricultural applications.
[0009] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0010] Figure 1 A flowchart illustrating a deep learning-based plant disease feature recognition method provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of the structure of a plant disease feature recognition system based on deep learning, provided in an embodiment of the present invention. Detailed Implementation
[0011] The present invention will be further described in detail below with reference to specific embodiments, but the implementation of the present invention is not limited thereto.
[0012] To achieve a comprehensive improvement in the accuracy, robustness, efficiency, and adaptability of plant disease identification and to better meet the complex needs of practical agricultural applications, this invention provides a deep learning-based method for plant disease feature identification. Figure 1 A flowchart illustrating a deep learning-based plant disease feature recognition method provided in this embodiment of the invention is shown below. Figure 1 As shown, it includes: S101. Obtain the image of the plant to be identified.
[0013] It should be noted that the plant images to be identified are raw digital images of plant leaves, stems, or fruits that may be infected with diseases, obtained directly by image acquisition devices such as digital cameras, smartphones, or field monitoring cameras under natural light conditions.
[0014] S102. Perform preprocessing operations on the plant images to be identified to obtain standardized image data.
[0015] Optionally, S102 includes: The images of the plants to be identified are standardized to obtain images of uniform size. A standardized image is obtained by performing color space conversion and color normalization on a uniformly sized image. Standardized image data is obtained by performing data augmentation and normalization on the standard converted image.
[0016] Optionally, color normalization includes contrast stretching, histogram equalization, and white balance correction.
[0017] The size standardization process can employ at least one of the following methods: center cropping, aspect ratio-preserving fill scaling, or direct scaling, to adjust the plant image to the target size. Center cropping cuts the target size from the center of the plant image, ensuring the main subject is centered but potentially losing edge information. Direct scaling does not preserve aspect ratio; it directly stretches or compresses the plant image to the target size, is computationally simple but may cause image distortion. Aspect ratio-preserving fill scaling first scales the plant image proportionally to one side of the target size, then fills in the shorter sides. This method preserves all image information without distortion; therefore, in this embodiment of the invention, aspect ratio-preserving fill scaling is preferred as the size standardization method.
[0018] In addition, the data enhancements mentioned above include one or more of the following operations: random rotation, horizontal or vertical flipping, brightness and contrast adjustment, addition of random noise, and random cropping to simulate occlusion.
[0019] S103. Input the standardized image data into the pre-trained plant disease identification model to obtain the final disease identification result.
[0020] The pre-trained plant disease identification model is trained based on plant image samples and a preset total loss. The preset total loss is composed of cross-entropy loss, binary cross-entropy loss, triplet loss, and Dice coefficient loss. The pre-trained plant disease identification model is equipped with a domain adaptation module and a fine-grained classification module. The domain adaptation module is based on an adversarial learning mechanism and performs domain offset correction through the collaborative work of a feature extractor, a domain classifier, and a domain discriminator with gradient inversion. The fine-grained classification module integrates residual attention and metric learning to distinguish visually similar disease features.
[0021] This invention provides a deep learning-based method for plant disease feature recognition. First, by introducing a domain adaptation module and using an adversarial learning mechanism for domain offset correction, it addresses the cross-domain generalization limitations of pre-trained plant disease recognition models caused by differences in training data distribution, significantly mitigating performance degradation in different regions, varieties, or environments. Second, by designing a fine-grained classification module that integrates residual attention and metric learning, it solves the challenge of distinguishing fine-grained features in pre-trained plant disease recognition models that differentiate between early symptoms of visually similar diseases or progressively changing severity of the same disease, effectively reducing category confusion. Finally, by combining cross-entropy loss, binary cross-entropy loss, triplet loss, and Dice coefficient loss to construct a preset total loss, and coordinating it with the domain adaptation and fine-grained classification modules, it enhances the accuracy and stability of lesion segmentation and localization in complex field scenarios such as uneven lighting and shading. Simultaneously, by focusing on key features through an attention mechanism and efficient architecture design, it alleviates the contradiction between complexity and inference efficiency in pre-trained plant disease recognition models. In summary, the method of this invention achieves a comprehensive improvement in the accuracy, robustness, efficiency, and adaptability of plant disease identification, and can better meet the complex needs of practical agricultural applications.
[0022] Optionally, the pre-trained plant disease identification model further includes: a feature extraction network, a feature fusion module, and an attention segmentation module; the feature extraction network, feature fusion module, domain adaptation module, fine-grained classification module, and attention segmentation module are connected sequentially; the output of the domain adaptation module is also connected to the input of the attention segmentation module, and S103 includes: The feature extraction network performs multi-scale feature extraction on standardized image data to obtain multi-scale features. The multi-scale features include: a first feature map, a second feature map, and a third feature map. The first feature map, the second feature map, and the third feature map have different spatial resolutions and network depths. The feature fusion module performs feature fusion processing on multi-scale features to obtain multi-scale fused features; The domain adaptation module performs domain offset correction on the multi-scale fused features to obtain corrected features; The fine-grained classification module performs coarse classification of the lesion regions on the correction features to obtain the classification result feature vector; The attention segmentation module performs precise localization and segmentation of lesion areas based on correction features and classification result feature vectors, and outputs the final disease identification results.
[0023] The feature extraction network can be implemented using existing deep convolutional neural network architectures, including but not limited to ResNet, VGGNet, or EfficientNet. In one specific embodiment, ResNet-50 is used as the backbone network, and the output feature maps of its conv3_x, conv4_x, and conv5_x layers are taken as the first feature map, the second feature map, and the third feature map, respectively.
[0024] Optionally, the feature fusion module performs feature fusion processing on the multi-scale features to obtain multi-scale fused features, including: Perform on the third feature map Convolution processing is performed to obtain the initial top-level feature map; Perform on the initial top-level feature map Double upsampling is performed to obtain the first upsampling result. The first upsampling result is then compared with the second feature map. The results of the convolution process are added element by element to obtain the first fused feature map; Perform on the first fused feature map Double upsampling is performed to obtain a second upsampling result. This second upsampling result is then compared with the first feature map. The results of the convolution process are added element by element to obtain the second fused feature map; Perform on the second fusion feature map Convolution processing yields the first enhanced feature map; The first enhanced feature map is processed with a step size of of The first downsampling result is obtained by multiplying the sampling time by 10. The first downsampling result is then combined with the first fused feature map. The results of the convolution process are added element by element to obtain the second enhanced feature map; The second enhanced feature map is processed with a step size of of After downsampling by a factor of two, a second downsampling result is obtained. This second downsampling result is then compared with the initial top-level feature map. The results of the convolution process are added element by element to obtain the third enhanced feature map; The first, second, and third enhanced feature maps are scale-aligned and then stitched together along the channel dimension to obtain multi-scale fused features.
[0025] Scale alignment is achieved through upsampling. Specifically, since the first, second, and third enhanced feature maps have different spatial resolutions from high to low, they need to be unified to the same size to enable them to be stitched together along the channel dimension. In this embodiment, the second and third enhanced feature maps, which have lower resolutions, are gradually enlarged to the same height and width as the first enhanced feature map, which has the highest resolution, through bilinear interpolation upsampling. This process ensures that feature maps from different depths and carrying different levels of semantics correspond one-to-one in space. After scale alignment, the three aligned enhanced feature maps can be stitched together along the channel dimension to form a multi-scale fused feature. The number of channels in the multi-scale fused feature is equal to the sum of the number of channels in the three aligned enhanced feature maps. The vector at each spatial location is formed by connecting the corresponding feature vectors at the same location in the original enhanced feature maps before alignment, thus achieving effective integration of multi-scale information.
[0026] Optionally, the input of the feature extractor is connected to the output of the feature fusion module, and the output of the feature extractor is connected to the input of the domain classifier. The neighborhood discriminator contains a gradient inversion layer, and the input of the gradient inversion layer is connected to the output of the feature extractor. The output of the feature extractor is also connected to the input of the fine-grained classification module and the input of the attention segmentation module; The gradient reversal layer is used to reverse the gradient of backpropagation during the training phase of the domain adaptation module. Through the collaborative work of the feature extractor, the domain classifier, the gradient reversal layer and the domain discriminator, an adversarial learning mechanism is formed during the training phase to optimize the feature extractor so that it generates domain-invariant domain-shared features.
[0027] It should be noted that during the training phase of the domain adaptation module, a complete adversarial learning mechanism is formed through the collaborative work of the feature extractor, domain classifier, domain discriminator, and a gradient inversion layer between the feature extractor and the domain discriminator. The feature extractor aims to extract discriminative features from the input feature data; the domain classifier provides primary task supervision to ensure that the extracted discriminative features are discriminative for the disease category; and the domain discriminator is used to determine the source domain (e.g., source or target domain) of the discriminative feature. The gradient inversion layer inverts the gradient from the domain discriminator passed to the feature extractor during backpropagation, which drives the feature extractor's optimization simultaneously with two objectives: improving the discriminative power of the features under the guidance of the domain classifier, and "deceiving" the domain discriminator through the adversarial gradient inversion, ultimately learning "domain-invariant features" that are both discriminative and insensitive to domain changes. Once the domain adaptation module is trained and the network parameters are fixed, in the practical application stage of the pre-trained plant disease identification model, the domain classifier, domain discriminator, and gradient inversion layer no longer participate in forward computation. At this point, the trained feature extractor acts as an independent feature transformer, and the processing result of the input multi-scale fused features is directly used as the final output of the domain adaptation module, i.e., the corrected features, for subsequent fine-grained classification modules. Furthermore, the gradient inversion operation refers to multiplying the loss gradient from the domain discriminator by a negative coefficient. In this embodiment, the negative coefficient is set to a value of... .
[0028] Furthermore, the feature extractor can employ the encoder portion of a convolutional neural network, whose core function is to map the high-dimensional input features to a low-dimensional, representative feature space. The neighborhood classifier consists of multiple fully connected layers and a final Softmax activation function, with its output dimension equal to the number of target disease categories. The neighborhood discriminator is a binary classification network, structurally similar to the neighborhood classifier. A gradient inversion layer is inserted between the neighborhood discriminator and the feature extractor, inverting the gradient from the neighborhood discriminator during backpropagation, forcing the feature extractor to learn neighborhood-invariant feature representations. It is important to note that the specific number of network layers, channels, and activation function types for the above components are not fixed. In practical applications, existing mature networks adapted to the task (such as ResNet encoders and MLP classification heads) can be directly used, or lightweight or customized variant structures can be designed according to specific data characteristics and computational resource constraints to balance performance and efficiency.
[0029] Optionally, the fine-grained classification module includes a feature encoding submodule, a metric learning submodule, and a classification output submodule connected in sequence. The fine-grained classification module performs coarse classification processing on the correction features for lesion regions, obtaining a classification result feature vector, including: The feature encoding submodule is used to perform feature encoding processing on the correction features to obtain encoded features; The metric learning submodule is used to map encoded features to a metric space to obtain a metric space feature vector. The classification output submodule performs coarse classification based on the feature vector of the metric space to obtain the classification result feature vector; The feature encoding submodule adopts a residual attention network structure, which contains multiple attention residual blocks. Attention residual blocks contain sequentially connected channel attention units and spatial attention units; The channel attention unit contains a global average pooling layer and a global max pooling layer set in parallel. The outputs of the global average pooling layer and the global max pooling layer are interconnected and sequentially connected to the first fully connected layer, the second fully connected layer, the element-wise summation layer, and the first sigmoid activation function layer. The number of neurons in the first fully connected layer is one-quarter of the number of channels of the correction feature, and the number of neurons in the second fully connected layer is equal to the number of channels of the correction feature. The spatial attention unit consists of a channel-dimensional average pooling layer, a channel-dimensional max pooling layer, and a channel splicing layer connected in sequence. Convolutional layer and second Sigmoid activation function layer; The classification output submodule contains a third fully connected layer and a third Softmax activation function layer.
[0030] The metric learning submodule employs an embedding network as its core architecture. This embedding network consists of a series of non-linear transformation layers, including multiple fully connected layers stacked sequentially with global pooling layers. The metric learning submodule is used to non-linearly map high-dimensional encoded features to a low-dimensional metric space. In this low-dimensional metric space, the Euclidean or cosine distance between sample features directly reflects their semantic similarity; that is, features of the same category of disease are close to each other, while features of different categories are far apart. The training of the metric learning submodule relies on the supervision of the metric learning loss function (triple loss) to optimize the parameters of the embedding network, thereby ensuring that the mapped metric space feature vectors have extremely strong class discriminative power.
[0031] The attention segmentation module is essentially a semantic segmentation network. In this embodiment of the invention, the attention segmentation module is implemented using the U-Net architecture. Specifically, the attention segmentation module performs precise localization and segmentation of lesion regions based on correction features and classification result feature vectors, outputting the final disease identification result. The implementation process is as follows: First, feature modulation and fusion are performed. The correction features serve as the main input to the U-Net encoder, preserving rich spatial details and intermediate features that have undergone domain adaptation. Simultaneously, the classification result feature vector is used as high-level semantic guidance. Specifically, the classification result feature vector is passed through a fully connected layer and a reshaping operation to generate one or more spatial attention weight maps that match the spatial dimensions of the correction features. Subsequently, these attention weight maps are weighted with the correction features through element-wise multiplication, thereby enhancing the response of the feature channels and spatial regions most relevant to the target disease category, forming modulated enhanced features.
[0032] Next, the modulated enhanced features are input into the decoder of U-Net. The decoder gradually recovers the spatial resolution of the modulated enhanced features through a series of upsampling layers and convolutional layers. During this process, U-Net's unique skip connection structure concatenates low-level detail features of the same scale in the encoder with high-level semantic features of the corresponding layers in the decoder to fuse multi-scale information and optimize the fineness of the segmentation boundaries. Finally, the decoder outputs the decoded feature map.
[0033] Finally, the decoded feature map is fed into a... The convolutional layer acts as the classification head, and the number of output channels equals the sum of the number of "background" channels and the number of all target disease categories. Then, the Softmax function is used to calculate the category probability distribution at each pixel location. The index of the category with the highest probability at each pixel location is selected to generate the final pixel-level segmentation mask, which is the final disease identification result.
[0034] Optionally, the training process of the pre-trained plant disease identification model includes: Acquire plant image samples; Standardized sample data are obtained by preprocessing plant image samples; Standardized sample data are input into the initial plant disease identification model, and iterative training is performed based on the preset total loss; The initial plant disease identification model that meets the iteration stopping condition is used as the pre-trained plant disease identification model; The iteration stops when the number of iterations reaches the iteration threshold or the function value of the preset total loss is continuously less than the loss threshold.
[0035] Optionally, the preset total loss is expressed as: ; ; ; ; ; in, This represents the loss value of the preset total loss. Indicates the first weight. Indicates the second weight. Indicates the third weight. Indicates the fourth weight. This represents the value of the cross-entropy loss. This represents the value of the domain adaptive loss. This represents the value of the triplet loss. This represents the value of the segmentation loss. Represents the cross-entropy loss function. This represents the probability distribution of predicted disease categories. Indicates the actual disease category label. This represents the binary cross-entropy loss function. This represents the probability predicted by the domain discriminator regarding the source of the input features. Represents the actual domain label, Represents the distance metric function. Indicates anchor point sample, Indicates and The feature vectors of positive samples belonging to the same disease category. Indicates the anchor point sample Feature vectors of negative samples belonging to different disease categories Represents boundary parameters, This represents the binary cross-entropy loss function combined with Sigmoid activation. This represents the predicted lesion region segmentation mask. Indicates the true segmentation mask label. This represents the loss in the Dice coefficient.
[0036] To verify the effectiveness of the deep learning-based plant disease feature recognition method proposed in this invention, this experiment designed a cross-domain recognition task on a publicly available plant disease image dataset and compared it with existing mainstream methods in terms of classification accuracy, segmentation quality, and other dimensions.
[0037] 1. The experimental setup is as follows: The experiment uses the widely used public dataset PlantVillage. To simulate the real-world domain offset problem, the PlantVillage dataset is divided into two subdomains based on the acquisition device and lighting conditions.
[0038] Source domain: Contains 15,000 images of tomato diseases taken with a DSLR camera under controlled laboratory lighting conditions, covering 8 disease categories (such as early blight, late blight, leaf mold, etc.) and healthy leaves. This subset has complete labels and is used for model training.
[0039] Target domain: Contains tomato disease images taken with a smartphone in a natural field environment, with the same categories as the source domain, totaling 3000 images. This subset simulates real-world application scenarios and is used for testing purposes only; its images differ significantly from the source domain in terms of color, background, and lighting uniformity.
[0040] The evaluation indicators are as follows: The model's overall ability to identify disease categories was evaluated using mean accuracy (mAcc) and macro-averaged F1 score (Macro-F1). The model's pixel-level segmentation accuracy of lesion areas was evaluated using mean intersection-over-union (mIoU) and Dice coefficient.
[0041] In addition, for a comprehensive evaluation, this experiment selected two types of methods for comparison, including Attention Mechanism Convolutional Neural Network (AM-CNN) and Domain-Adversarial Neural Network (DANN).
[0042] All models are implemented using the PyTorch framework. During training, the Adam optimizer is used, with an initial learning rate of 1e-4 and a batch size of 16. , , and The values were set to 0.4, 0.2, 0.1, and 0.3 respectively. The model was trained for a total of 100 epochs, with a loss threshold of 0.01. Training was stopped early if the preset total loss value was below 0.01 for 10 consecutive iterations on the validation set. Data augmentation included random horizontal flipping, color jittering, and random cropping.
[0043] 2. The experimental results are as follows: Table 1. Performance comparison results of each method on the target domain test set.
[0044] As shown in Table 1, the method of this invention achieves optimal performance across the target domain, with classification mAcc and segmentation mIoU reaching 87.2% and 74.6%, respectively, significantly higher than all compared methods. This directly demonstrates the effectiveness of the domain adaptation module. Compared with DANN methods specifically designed to address domain shift, the method of this invention achieves a 5.7 percentage point higher mAcc, indicating that the adversarial learning mechanism and multi-module collaborative design are superior in generating domain-invariant features.
[0045] In terms of classification metrics, this invention outperforms AM-CNN models that focus on fine-grained classification. This is due to the synergistic effect of the residual attention network and metric learning in the fine-grained classification module. The attention mechanism helps the model focus on the subtle discriminative regions of lesions, while metric learning, through triplet loss constraints, effectively separates visually similar lesions in the feature space, thereby reducing class confusion and improving the Macro-F1 score.
[0046] Furthermore, this invention is the first end-to-end framework to uniformly achieve classification and segmentation in plant disease identification, while simultaneously addressing domain offset and fine-grained identification. Experimental results show that the improvement in segmentation performance is comparable to that in classification performance. This indicates that by pre-setting the total loss function, the model improves feature discriminativeness and domain invariance while directly optimizing the attention-modulated features used for segmentation, resulting in more accurate lesion localization and greater robustness in complex backgrounds.
[0047] In summary, the experimental results fully demonstrate that, compared with existing mainstream methods, the plant disease feature recognition method provided by this invention effectively mitigates the performance degradation caused by domain offset through the domain adaptation module, improves the ability to distinguish visually similar diseases through the fine-grained classification module, and achieves significant improvements in both classification accuracy and segmentation quality through end-to-end optimization using multi-task loss. This experiment verifies the effectiveness of this invention in addressing the complex needs of real-world agricultural applications, such as variable environments and similar disease symptoms.
[0048] The method provided in this embodiment of the invention can be applied to electronic devices. Specifically, the electronic device can be a desktop computer, a portable computer, a smart mobile terminal, a server, etc., and this embodiment of the invention does not limit the application to such devices.
[0049] Based on the same inventive concept, embodiments of the present invention also provide a plant disease feature recognition system based on deep learning. Figure 2 A schematic diagram of a deep learning-based plant disease feature recognition system provided in an embodiment of the present invention is shown below. Figure 2 As shown, it includes: an acquisition unit 201, a preprocessing unit 202, and an identification unit 203; Acquisition unit 201 is used to acquire an image of the plant to be identified; Preprocessing unit 202 is used to perform preprocessing operations on the plant image to be identified to obtain standardized image data; The recognition unit 203 is used to input standardized image data into a pre-trained plant disease recognition model to obtain the final disease recognition result; The pre-trained plant disease identification model is trained based on plant image samples and a preset total loss. The preset total loss is composed of cross-entropy loss, binary cross-entropy loss, triplet loss, and Dice coefficient loss. The pre-trained plant disease identification model is equipped with a domain adaptation module and a fine-grained classification module. The domain adaptation module is based on an adversarial learning mechanism and performs domain offset correction through the collaborative work of a feature extractor, a domain classifier, and a domain discriminator with gradient inversion. The fine-grained classification module integrates residual attention and metric learning to distinguish visually similar disease features.
[0050] Although the invention has been described herein in conjunction with various embodiments, those skilled in the art, by reviewing the accompanying drawings and the disclosure, will understand and implement other variations of the disclosed embodiments in carrying out the claimed invention. In this description, the word "comprising" does not exclude other components or steps, "a" or "an" does not exclude a plurality, and "a plurality" means two or more, unless otherwise explicitly specified. Furthermore, while different embodiments may describe certain measures, this does not mean that these measures cannot be combined to produce good results.
[0051] The above description, in conjunction with specific preferred embodiments, provides a further detailed explanation of the present invention. It should not be construed that the specific implementation of the present invention is limited to these descriptions. For those skilled in the art, various simple deductions or substitutions can be made without departing from the inventive concept, and all such modifications and substitutions should be considered within the scope of protection of the present invention.
Claims
1. A method for identifying plant disease features based on deep learning, characterized in that, include: Acquire images of the plant to be identified; The plant image to be identified is preprocessed to obtain standardized image data; The standardized image data is input into the pre-trained plant disease identification model to obtain the final disease identification result; The pre-trained plant disease identification model is trained based on plant image samples and a preset total loss. The preset total loss is composed of cross-entropy loss, binary cross-entropy loss, triplet loss, and Dice coefficient loss. The pre-trained plant disease identification model includes a domain adaptation module and a fine-grained classification module. The domain adaptation module is based on an adversarial learning mechanism and performs domain offset correction through the collaborative work of a feature extractor, a domain classifier, and a domain discriminator with gradient inversion. The fine-grained classification module integrates residual attention and metric learning to distinguish visually similar disease features.
2. The plant disease feature recognition method based on deep learning according to claim 1, characterized in that, The pre-trained plant disease identification model further includes: a feature extraction network, a feature fusion module, and an attention segmentation module; the feature extraction network, the feature fusion module, the domain adaptation module, the fine-grained classification module, and the attention segmentation module are connected sequentially; the output of the domain adaptation module is also connected to the input of the attention segmentation module; the step of inputting the standardized image data into the pre-trained plant disease identification model to obtain the final disease identification result includes: The feature extraction network performs multi-scale feature extraction on the standardized image data to obtain multi-scale features; the multi-scale features include: a first feature map, a second feature map, and a third feature map; the first feature map, the second feature map, and the third feature map have different spatial resolutions and network depths; The feature fusion module performs feature fusion processing on the multi-scale features to obtain multi-scale fused features; The domain adaptation module performs domain offset correction on the multi-scale fused features to obtain corrected features; The fine-grained classification module performs coarse classification of the lesion regions on the correction features to obtain the classification result feature vector; The attention segmentation module performs precise localization and segmentation of the lesion area based on the correction features and the classification result feature vector, and outputs the final disease identification result.
3. The plant disease feature recognition method based on deep learning according to claim 1, characterized in that, The preprocessing operation on the plant image to be identified to obtain standardized image data includes: The image of the plant to be identified is subjected to size standardization processing to obtain an image of uniform size; The uniform-sized image is subjected to color space conversion and color normalization to obtain a standard converted image; The standardized image data is obtained by performing data augmentation and normalization on the standard converted image.
4. The plant disease feature identification method based on deep learning according to claim 3, characterized in that, The color normalization process includes contrast stretching, histogram equalization, and white balance correction.
5. The plant disease feature identification method based on deep learning according to claim 2, characterized in that, The feature fusion module performs feature fusion processing on the multi-scale features to obtain multi-scale fused features, including: Perform on the third feature map Convolution processing is performed to obtain the initial top-level feature map; Perform the initial top-level feature map Double upsampling is performed to obtain a first upsampling result. The first upsampling result is then compared with the second feature map. The results of the convolution process are added element by element to obtain the first fused feature map; Perform on the first fused feature map Double upsampling is performed to obtain a second upsampling result. The second upsampling result is then compared with the first feature map. The results of the convolution process are added element by element to obtain the second fused feature map; Perform on the second fused feature map Convolution processing yields the first enhanced feature map; The first enhanced feature map is processed with a step size of of The first downsampling result is obtained by multiplying the sampling time by 10. The first downsampling result is then combined with the first fused feature map. The results of the convolution process are added element by element to obtain the second enhanced feature map; The second enhanced feature map is processed with a step size of of The second downsampling result is obtained by subsampling the first downsampling result and then compared with the initial top-level feature map. The results of the convolution process are added element by element to obtain the third enhanced feature map; The first enhanced feature map, the second enhanced feature map, and the third enhanced feature map are scale aligned and then stitched together along the channel dimension to obtain the multi-scale fused feature.
6. The plant disease feature recognition method based on deep learning according to claim 2, characterized in that, The input of the feature extractor is connected to the output of the feature fusion module, and the output of the feature extractor is connected to the input of the domain classifier. The neighborhood discriminator includes a gradient inversion layer, and the input of the gradient inversion layer is connected to the output of the feature extractor. The output of the feature extractor is also connected to the input of the fine-grained classification module and the input of the attention segmentation module; The gradient reversal layer is used to reverse the gradient of backpropagation during the training phase of the domain adaptation module. Through the collaborative work of the feature extractor, the domain classifier, the gradient reversal layer and the domain discriminator, an adversarial learning mechanism is formed during the training phase to optimize the feature extractor so that it generates domain-invariant domain-shared features.
7. The plant disease feature identification method based on deep learning according to claim 2, characterized in that, The fine-grained classification module comprises a feature encoding submodule, a metric learning submodule, and a classification output submodule connected in sequence. The fine-grained classification module performs coarse classification processing on the corrected features to obtain a classification result feature vector, including: The feature encoding submodule is used to perform feature encoding processing on the correction features to obtain encoded features; The metric learning submodule is used to map the encoded features to the metric space to obtain a metric space feature vector. The classification output submodule performs coarse classification processing based on the feature vector of the metric space to obtain the classification result feature vector; The feature encoding submodule adopts a residual attention network structure, which contains multiple attention residual blocks. The attention residual block comprises sequentially connected channel attention units and spatial attention units; The channel attention unit includes a global average pooling layer and a global max pooling layer arranged in parallel. The outputs of the global average pooling layer and the global max pooling layer are interconnected and sequentially connected to a first fully connected layer, a second fully connected layer, an element-wise addition layer, and a first sigmoid activation function layer. The number of neurons in the first fully connected layer is one-quarter of the number of channels in the correction feature, and the number of neurons in the second fully connected layer is equal to the number of channels in the correction feature. The spatial attention unit comprises, in sequence, a channel-dimensional average pooling layer, a channel-dimensional max pooling layer, and a channel splicing layer. Convolutional layer and second Sigmoid activation function layer; The classification output submodule includes a third fully connected layer and a third Softmax activation function layer.
8. The plant disease feature identification method based on deep learning according to claim 1, characterized in that, The training process of the pre-trained plant disease identification model includes: Acquire plant image samples; The plant image samples are preprocessed to obtain standardized sample data; The standardized sample data is input into the initial plant disease identification model, and iterative training is performed based on the preset total loss. The initial plant disease identification model that satisfies the iteration stopping condition is used as the pre-trained plant disease identification model; The iteration stopping condition is that the number of iterations reaches the iteration number threshold or the function value of the preset total loss is continuously less than the loss threshold.
9. The plant disease feature recognition method based on deep learning according to claim 1, characterized in that, The preset total loss is expressed as: ; ; ; ; ; in, This represents the loss value of the preset total loss. Indicates the first weight. Indicates the second weight. Indicates the third weight. Indicates the fourth weight. This represents the value of the cross-entropy loss. This represents the value of the domain adaptive loss. This represents the value of the triplet loss. This represents the value of the segmentation loss. Represents the cross-entropy loss function. This represents the probability distribution of predicted disease categories. Indicates the actual disease category label. This represents the binary cross-entropy loss function. This represents the probability predicted by the domain discriminator regarding the source of the input features. Represents the actual domain label, Represents the distance metric function. Indicates anchor point sample, Indicates and The feature vectors of positive samples belonging to the same disease category. Indicates the anchor point sample Feature vectors of negative samples belonging to different disease categories Represents boundary parameters, This represents the binary cross-entropy loss function combined with Sigmoid activation. This represents the predicted lesion region segmentation mask. Indicates the true segmentation mask label. This represents the loss in the Dice coefficient.
10. A plant disease feature recognition system based on deep learning, characterized in that, include: The system comprises an acquisition unit, a preprocessing unit, and a recognition unit. The acquisition unit is used to acquire an image of the plant to be identified; The preprocessing unit is used to perform preprocessing operations on the plant image to be identified to obtain standardized image data; The recognition unit is used to input the standardized image data into a pre-trained plant disease recognition model to obtain the final disease recognition result; The pre-trained plant disease identification model is trained based on plant image samples and a preset total loss. The preset total loss is composed of cross-entropy loss, binary cross-entropy loss, triplet loss, and Dice coefficient loss. The pre-trained plant disease identification model includes a domain adaptation module and a fine-grained classification module. The domain adaptation module is based on an adversarial learning mechanism and performs domain offset correction through the collaborative work of a feature extractor, a domain classifier, and a domain discriminator with gradient inversion. The fine-grained classification module integrates residual attention and metric learning to distinguish visually similar disease features.