A plant disease detection method and system based on non-adversarial unsupervised domain adaptation
Through a non-adversarial unsupervised domain adaptation method, using hybrid neural networks and auxiliary uncertainty regularization, the problem of large differences between domains in plant disease detection is solved, and the detection accuracy under natural conditions in the field is improved, achieving more than 10% accuracy improvement.
Patent Information
- Application Number
- CN202311727794.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-15
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2043-12-15
AI Technical Summary
Existing deep learning methods cannot effectively solve the problem of large inter-domain differences and small intra-domain differences in image acquisition under natural conditions in the laboratory environment and field in plant disease detection, resulting in low detection accuracy.
Adopting a non-adversarial unsupervised domain adaptation method, by constructing a hybrid neural network structure, using a residual neural network for feature extraction, and introducing auxiliary uncertainty regularization, the classification loss function and the total loss function are calculated, and network training is performed to improve transfer reliability and generalization ability.
The accuracy of plant disease detection under natural conditions in the field has been improved, the generalization ability and migration performance of the model have been significantly improved, and the detection accuracy has increased by more than 10%.
Smart Images

Figure CN117893476B
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of machine vision technology, unsupervised domain adaptation and plant disease detection, and in particular to a plant disease detection method and system based on non-adversarial unsupervised domain adaptation. Background Art
[0002] Plant diseases are one of the most complex, variable and difficult to overcome factors affecting plant growth. They are a biological disaster for global agricultural production and ecological security. The key to plant disease prevention and control is to be able to detect disease-affected areas in a timely and accurate manner and identify the types of diseases. As a representative of the rise of new artificial intelligence, deep learning has made significant progress and has solved the problems that the artificial intelligence community has been working on for many years but has not made significant progress. In recent years, deep learning technology has gradually been introduced into plant disease detection and identification, and has achieved rapid development in this field, with a large number of research results emerging, and has become a research hotspot in this field. As a sub-field of deep learning, domain adaptation can better solve the problems of low quality and no labels of images taken under natural conditions in the field.
[0003] In recent years, the research on plant disease detection based on domain adaptation is as follows: Ghazi published "Plant identification using deep neural networks via optimization of transfer learning parameters" in Volume 235 of Neurocomputing in 2017, which used three popular CNN architectures: AlexNet, VggNet and GoogLeNet, and evaluated the many factors that affect the performance of these networks in plant disease identification tasks, while using transfer learning to fine-tune the pre-trained model. Barbedo published "Impact of Dataset Size and Variety on the Effectiveness of Deep Learning and Transfer Learning for Plant Disease Classification. Computers and Electronics in Agriculture" in Volume 153 of Computers and Electronics in Agriculture in 2018. This study used the last few layers of a pre-trained GoogleNet to fine-tune a database of 70 plant diseases and used the network for plant disease classification. Haseeb published "Unsupervised image translation using adversarial networks for improved plant disease recognition" in Volume 168 of Computers and Electronics in Agriculture in 2020. The paper uses AR-GAN to perform synthetic enhancement on plant disease datasets to improve plant disease recognition performance in data-scarce environments. However, the above methods do not take into account the large inter-domain differences and small intra-domain differences between images collected under laboratory environments and natural field conditions. Summary of the invention
[0004] In order to solve the above problems, the present invention proposes a non-adversarial unsupervised domain adaptive plant disease detection method and system.
[0005] The network is effectively trained without using adversarial training and back propagation, and the convergence speed is fast; constructing a hybrid neural network structure improves the accuracy of the collected plant disease images, and the introduced auxiliary uncertainty regularization improves the reliability of migration from the source domain to the target domain, and has good generalization ability.
[0006] In order to achieve the above object, the present invention is implemented by the following technical solutions:
[0007] A non-adversarial unsupervised domain adaptation method for plant disease detection, the method comprising:
[0008] Collect plant disease images in laboratory environment and natural field conditions respectively, and mark the plant disease images;
[0009] Using a residual neural network, extracting features from the collected plant disease images and converting them into feature images;
[0010] Constructing a hybrid neural network structure, learning multiple representation information vectors for the feature image, and calculating the classification loss function after splicing;
[0011] Embedding the subdomain adaptation method into the hybrid neural network structure to measure the gap between domains;
[0012] Obtaining migration data according to the classification loss function and introducing auxiliary uncertainty regularization;
[0013] Sampling the same number of the plant disease images and obtaining the optimal total loss function according to the migration data training is a preferred solution of the present invention, wherein the plant disease images include:
[0014] In the laboratory environment, there is labeled image data and it is marked as the source domain;
[0015] The image data is unlabeled under natural field conditions and is marked as the target domain;
[0016] The acquired source domain and target domain image data are enhanced by adjusting, randomly cropping, and randomly flipping.
[0017] As a preferred solution of the present invention, the feature image is based on a residual neural network using a deep residual network
[0018] ResNet performs feature extraction and converts the original image into a feature image that is easy to express and summarize.
[0019] As a preferred solution of the present invention, the hybrid neural network structure is composed of 1x1 convolution, 3x3 convolution, 5x5 convolution and average pooling; each substructure of the hybrid neural network structure is responsible for extracting different feature information suitable for domain migration; the classification loss function uses cross entropy to set the learning rate of the classifier to 10 times that of other layers.
[0020] As a preferred solution of the present invention, the subdomain adaptation method embeds the representation vector extracted from each substructure of the hybrid neural network structure to calculate the gap between the source domain and the target domain. The calculation formula is as follows:
[0021]
[0022] Where p is the data distribution obtained in the source domain; q is the data distribution obtained in the target domain; is the difference between the source domain and the target domain; C is the number of subdomains; n s is the number of source domain data; n t is the number of target domain data; w sc is the weight of a subdomain in the source domain; w tc is the weight of a subdomain in the target domain; k is a vector; M s is the source domain representation vector; M t Represent the target domain vector.
[0023] As a preferred solution of the present invention, the classification loss function and auxiliary uncertainty regularization calculation formula are as follows:
[0024]
[0025]
[0026] Where n s is the number of source domain data, is the source domain training sample, is the annotation of the source domain training sample, f is the feature extraction function, J is the single sample loss function, L cls is the classification loss function, In is the natural exponential function, is the mathematical expectation, L en is the entropy calculation formula.
[0027] As a preferred solution of the present invention, the total loss function follows the standard small batch stochastic gradient descent algorithm SGD, where the momentum is set to 0.9 and a total of 200 training periods are performed. The calculation formula is as follows:
[0028]
[0029] In the formula, h is the feature transfer function (module), g is the CNN feature extraction function (module), J is the single sample loss function, min is the minimum value function, d is the measurement function of the distance between the two distributions, and n is r is the number of hybrid substructures; λ and γ are trade-off factors.
[0030] A non-adversarial unsupervised domain adaptation plant disease detection system, the system comprising:
[0031] Data acquisition module, used to collect plant disease images in laboratory environments and natural field conditions;
[0032] A data marking module, used for marking the collected image data with plant disease images;
[0033] An image conversion module is used to extract the features of the collected plant disease images and convert them into feature images;
[0034] The model building module is used to build a hybrid neural network structure, learn multiple representation information vectors, and calculate the classification loss function after splicing;
[0035] A data measurement module, used for embedding the subdomain adaptation method into the hybrid neural network structure to measure the gap between domains;
[0036] A data training module is used to sample the same amount of plant disease image data and obtain an optimal total loss function based on the migration data training. One or more processors; a memory is used to store one or more programs; when one or more of the programs are executed by the processor, a flow identification method based on semi-supervised learning as described above is implemented.
[0037] A computer-readable storage medium having a computer program stored thereon, characterized in that when the program is executed by a processor, a non-adversarial and unsupervised domain-adapted plant disease detection method as described above is implemented.
[0038] Compared with the prior art, the present invention has the following beneficial effects:
[0039] (1) The present invention does not use adversarial training, and effectively trains the network through back propagation, with a faster convergence speed.
[0040] (2) The hybrid neural network structure designed in the present invention can obtain as much characterization information of plant diseases as possible, thereby improving the accuracy of plant disease detection, especially for plant disease images collected under natural field conditions.
[0041] (3) The auxiliary uncertainty regularization introduced in this invention can improve the reliability of migration from the source domain to the target domain and has good generalization ability. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0043] in:
[0044] Figure 1 It is a schematic diagram of the overall architecture of an embodiment of the present invention;
[0045] Figure 2 It is a system modular structure diagram of an embodiment of the present invention. DETAILED DESCRIPTION
[0046] In order to make the purpose, technical solution and advantages of the embodiment of the present invention clearer, the technical solution of the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings of the embodiment of the present invention. Obviously, the described embodiment is a part of the embodiment of the present invention, not all of the embodiments. Based on the described embodiment of the present invention, all other embodiments obtained by ordinary technicians in this field belong to the scope of protection of the present invention.
[0047] like Figure 1 As shown in FIG. 1 , an embodiment of the present invention is provided, which provides a plant disease detection method based on non-adversarial unsupervised domain adaptation, comprising the following steps:
[0048] Collect plant disease images in laboratory environment and natural field conditions respectively, and mark the plant disease images;
[0049] In one embodiment, the steps specifically include:
[0050] Obtain a data set. In transfer learning, two domains are involved, namely the source domain and the target domain. In the following embodiments, the source domain comes from the PlantVillage data set, and the target domain comes from the PlantDoc data set. The original PlantVillage data set was collected in a laboratory environment. It is a large public data set for plant disease detection. There are 54,306 labeled image data, including 38 disease types. The PlantDoc data set was collected under natural field conditions. There are 8,897 unlabeled image data, including 27 disease types. Since the original PlantVillage data set contains a lot of disease image data that is not in the PlantDoc data set, in order to avoid overfitting, 20% of the image data in the original PlantVillage data set are selected as the source domain. The specific types and quantities of diseases in the data set of this embodiment are shown in Table 1.
[0051] Table 1 Detailed information of source domain and target domain datasets.
[0052]
[0053]
[0054] For each dataset, the images are first resized to 256x256 and then randomly cropped to 224x224. In addition, the data are augmented by random flipping.
[0055] In one embodiment, the steps specifically include:
[0056] The feature image is based on the residual neural network and uses the deep residual network ResNet50 layer for feature extraction, which converts the original image into a feature image that is easy to express and summarize.
[0057] In one embodiment, the steps specifically include:
[0058] The hybrid neural network structure is composed of a 1x1 convolution, a 3x3 convolution, a 5x5 convolution and an average pooling layer;
[0059] Each substructure of the hybrid neural network structure is responsible for extracting different feature information suitable for domain migration;
[0060] The classification loss function uses cross entropy to set the learning rate of the classifier to 10 times that of other layers.
[0061] In one embodiment, the steps specifically include:
[0062] The subdomain adaptation method embeds the representation vector extracted from each substructure of the hybrid neural network structure and calculates the gap between the source domain and the target domain. The calculation formula is as follows:
[0063]
[0064] Where p is the data distribution obtained in the source domain; q is the data distribution obtained in the target domain; is the difference between the source domain and the target domain; C is the number of subdomains; n s is the number of source domain data; n t is the number of target domain data; w sc is the weight of a subdomain in the source domain; w tc is the weight of a subdomain in the target domain; k is a vector; M s is the source domain representation vector; M t Represent the target domain vector.
[0065] In one embodiment, the steps specifically include:
[0066] The classification loss function and auxiliary uncertainty regularization calculation formula are as follows:
[0067]
[0068]
[0069] Where n s is the number of source domain data.
[0070] In one embodiment, the steps specifically include:
[0071] The total loss function follows the standard mini-batch stochastic gradient descent algorithm SGD, where the momentum is set to 0.9 and a total of 200 training periods are calculated as follows:
[0072]
[0073] Where n r is the number of hybrid substructures; λ and γ are trade-off factors.
[0074] The learning rate of the classifier is set to 10 times that of other layers because it is trained from scratch. The training of this example follows the standard mini-batch stochastic gradient descent SGD algorithm with a momentum of 0.9. To eliminate the bias caused by the domain size in each mini-batch, sampling is based on the same amount of source and target domain data. A total of 200 epochs are trained and the entire network is optimized together with the total loss function.
[0075] In order to suppress the noisy activation in the early stage of training, the adaptive factor λ is gradually changed from 0 to 1 through a progressive strategy, where the progressive strategy is: and α is set to 10 in this case. Another factor γ in the total loss function is optimized by grid search over a predefined set {0, 0.01, 0.02, 0.03, 0.05, 0.1, 0.2, 0.5}.
[0076] Table 2 Model detection results table.
[0077] category apple corn Grape black pepper Potato tomato average Accuracy 71.45% 56.46% 85.49% 93.49% 67.42% 48.67% 56.06%
[0078] The cross-domain plant disease classification model proposed in the present invention realizes the effective migration of the model without labeling the target domain samples, and the recognition rate in the target domain is significantly improved compared with that without using domain adaptation technology.
[0079] like Figure 2 As shown in FIG. 1 , another embodiment of the present invention is provided, which provides a plant disease detection system based on non-adversarial unsupervised domain adaptation, including:
[0080] Data acquisition module, used to collect plant disease images in laboratory environments and natural field conditions;
[0081] A data marking module, used for marking the collected image data with plant disease images;
[0082] An image conversion module is used to extract the features of the collected plant disease images and convert them into feature images;
[0083] The model building module is used to build a hybrid neural network structure, learn multiple representation information vectors, and calculate the classification loss function after splicing;
[0084] A data measurement module, used for embedding the subdomain adaptation method into the hybrid neural network structure to measure the gap between domains;
[0085] The data training module is used to sample the same amount of plant disease image data and obtain the optimal total loss function based on the migration data training. This embodiment also provides a plant disease detection device based on non-adversarial unsupervised domain adaptation, including: one or more processors; a memory for storing one or more programs; when one or more programs are executed by one or more processors, a plant disease detection method based on non-adversarial unsupervised domain adaptation as described above is implemented.
[0086] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented using software, it can be implemented in whole or in part in the form of a computer program product, which includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. The storage medium can be a read-only memory, a disk or an optical disk, etc.
[0087] In summary, a plant disease detection method based on non-adversarial unsupervised domain adaptation proposed in an embodiment of the present invention effectively solves the problems of large inter-domain differences, small intra-domain differences, and small inter-domain differences in plant disease detection during the migration process. Compared with other migration methods, its accuracy is improved by more than 10%.
[0088] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine different embodiments or examples described in this specification and the features of different embodiments or examples, unless they are contradictory.
[0089] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0090] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A plant disease detection method based on non-adversarial unsupervised domain adaptation, characterized in that: The method comprises: Collect plant disease images in laboratory environment and natural field conditions respectively, and mark the plant disease images; Using a residual neural network, extracting features from the collected plant disease images and converting them into feature images; Constructing a hybrid neural network structure, learning multiple representation information vectors for the feature image, and calculating the classification loss function after splicing; Embedding the subdomain adaptation method into the hybrid neural network structure to measure the gap between domains; Obtaining migration data according to the classification loss function and introducing auxiliary uncertainty regularization; Sampling the same number of plant disease images, and obtaining an optimal total loss function based on the migration data training; The hybrid neural network structure is composed of a 1x1 convolution, a 3x3 convolution, a 5x5 convolution and an average pooling layer; each substructure of the hybrid neural network structure is responsible for extracting different feature information suitable for domain migration; the classification loss function uses cross entropy to set the learning rate of the classifier to 10 times that of other layers; The subdomain adaptation method embeds the representation vector extracted from each substructure of the hybrid neural network structure and calculates the gap between the source domain and the target domain. The calculation formula is as follows: Where p is the data distribution obtained in the source domain; q is the data distribution obtained in the target domain; is the difference between the source domain and the target domain; C is the number of subdomains; n S is the number of source domain data; n t is the number of target domain data; w sc is the weight of a subdomain in the source domain; w tc is the weight of a subdomain in the target domain; k is a vector; M S is the source domain representation vector; M t Represent the target domain vector; The classification loss function and auxiliary uncertainty regularization are calculated as follows: Where n s is the number of source domain data, x i s is the source domain training sample, y i s is the annotation of the source domain training sample, f is the feature extraction function, J is the single sample loss function, L cls is the classification loss function, In is the natural exponential function, IE x~Dt is the mathematical expectation, L en is the entropy calculation formula; The total loss function follows the standard small batch stochastic gradient descent algorithm SGD, where the momentum is set to 0.9 and a total of 200 training periods are calculated as follows: In the formula, h is the feature transfer function, g is the CNN feature extraction function, J is the single sample loss function, min is the minimum value function, d is the measurement function of the distance between the two distributions, and n is the distance between the two distributions. r is the number of hybrid substructures; λ and γ are trade-off factors.
2. A plant disease detection method based on non-adversarial unsupervised domain adaptation according to claim 1, characterized in that: The plant disease images include: In the laboratory environment, there is labeled image data and it is marked as the source domain; The image data is unlabeled under natural field conditions and is marked as the target domain; The acquired source domain and target domain image data are enhanced by adjusting, randomly cropping, and randomly flipping.
3. The method for plant disease detection based on non-adversarial unsupervised domain adaptation according to claim 1, characterized in that: The feature image uses a deep residual network ResNet50 to extract features and convert the original image into a feature image that is easy to express and summarize.
4. A system for plant disease detection based on a non-adversarial unsupervised domain adaptation method according to any one of claims 1 to 3, characterized in that: The system comprises: A data acquisition module is used to collect plant disease images under laboratory environment and natural field conditions; a data marking module is used to mark the collected image data with plant disease images; An image conversion module is used to extract the features of the collected plant disease images and convert them into feature images; The model building module is used to build a hybrid neural network structure, learn multiple representation information vectors, and calculate the classification loss function after splicing; A data measurement module, used for embedding the subdomain adaptation method into the hybrid neural network structure to measure the gap between domains; The data training module is used to sample the same amount of plant disease image data and obtain the optimal total loss function based on the migration data training.
5. A non-adversarial unsupervised domain adaptation plant disease detection device, characterized in that: The device includes: one or more processors; A memory for storing one or more programs; When one or more of the programs are executed by a processor, a non-adversarial, unsupervised domain-adapted plant disease detection method as described in any one of claims 1 to 3 is implemented.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, a non-adversarial, unsupervised, domain-adapted plant disease detection method as described in any one of claims 1 to 3 is implemented.
