Crop disease transfer learning identification method for facility agriculture
By combining decoupled generative networks and standard illumination style codes, the performance degradation of crop disease identification models in facility agriculture under varying illumination conditions is solved, achieving stable identification and efficient data utilization under different illumination environments.
Patent Information
- Application Number
- CN202511077209.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-01
- Publication Date
- 2025-11-07
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In facility agriculture, crop disease identification models show decreased performance and insufficient generalization ability and robustness when light intensity changes. Existing data augmentation methods cannot effectively solve the light drift problem.
A decoupled generative network is constructed to separate crop disease images into content codes and style codes. A standard illumination style code is defined, and a normalized illumination image is generated through a generator. A normalized disease dataset is constructed and a recognition model is trained.
Maintaining the accuracy and stability of the recognition model under different lighting conditions enhances the model's reusability and data utilization efficiency, and solves the domain drift problem caused by changes in lighting.
Smart Images

Figure CN120911547A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, and in particular to a crop disease transfer learning recognition method for facility agriculture. BACKGROUND
[0002] Facility agriculture, such as intelligent greenhouse and plant factory, has become a key mode for modern agriculture to achieve high yield, high quality and efficient production through precise control of the environment. In the current agricultural intensive production system, early and accurate identification and prevention of crop diseases are the core link to protect the economic benefits. In recent years, with the rapid development of artificial intelligence technology, computer vision methods represented by deep learning, especially convolutional neural network (CNN), have become the mainstream technology for automatic crop disease identification. In addition, due to the application of transfer learning strategy, some models have the ability to identify specific crop diseases, reducing the dependence on massive labeled data and promoting the innovative development in the field of agriculture.
[0003] However, these methods still have some challenges in the current deployment of facility agriculture. First, the lighting conditions in the facility agriculture environment usually present high complexity and dynamics. Natural light at different times, diversified spectrum of LED supplementary light, and relative position changes between light source and crops jointly cause dramatic and nonlinear differences in color temperature, brightness, contrast, shadow and highlight of the image. This drift problem caused by lighting changes will cause the model trained under the lighting conditions to have a sharp decline in recognition performance when applied to new and unseen lighting environments, and the generalization ability and robustness are seriously insufficient. Although traditional data enhancement methods (such as random brightness and contrast adjustment) can alleviate this problem to some extent, they are essentially global linear transformations and cannot fundamentally simulate the local and nonlinear lighting artifacts caused by three-dimensional space occlusion and complex light source physical properties. Therefore, it is necessary to eliminate the interference of lighting changes on the performance of the recognition model from the root. SUMMARY
[0004] This section is intended to summarize some aspects of the embodiments of the present application and briefly introduce some preferred embodiments. Some simplifications or omissions may be made in this section and the abstract and title of the specification to avoid obscuring the purpose of this section, the abstract and the title, and such simplifications or omissions cannot be used to limit the scope of the present application.
[0005] In view of the above existing problems, the present application is proposed. Therefore, the present application provides a crop disease transfer learning recognition method for facility agriculture to solve the problems proposed in the background art.
[0006] To solve the above technical problems, the present application provides the following technical solutions: a crop disease transfer learning identification method for facility agriculture, comprising:
[0007] A pre-trained decoupling generation network is created to encode crop disease images, extract the content code of the image pathological features, and separate the disease images into content codes and style codes through the decoupling generation network;
[0008] A standard light style code is defined, and based on the extracted content code and the light style code, a normalized standard test image under light is generated through the generator of the decoupling generation network;
[0009] A normalized disease data set is constructed based on the normalized test image, and the data set is trained to create a pre-trained crop disease identification model. The test image is input into the model to output the identification result of the crop disease.
[0010] As a preferred scheme of the crop disease transfer learning identification method for facility agriculture of the present application, wherein: the pre-trained decoupling generation network and the pre-trained crop disease identification model are obtained by the following steps:
[0011] A first image set containing crop disease images under multiple light conditions and a second image set containing multiple light environment features are obtained;
[0012] The decoupling generation network is trained;
[0013] The standard light style code is defined;
[0014] Using the trained decoupling generation network, each crop disease image in the first image set is converted into a corresponding normalized disease image to construct the normalized disease data set;
[0015] Based on the normalized disease data set, the crop disease identification model is trained by transfer learning.
[0016] As a preferred scheme of the crop disease transfer learning identification method for facility agriculture of the present application, wherein: the decoupling generation network is trained by at least one of the following constraint conditions:
[0017] The first constraint condition: the content code and the first style code reconstructed by the crop disease image coding are consistent with the original crop disease image;
[0018] The second constraint condition: the image generated by the generator has visual authenticity;
[0019] The third constraint condition is that the first style code of the first crop disease image is cross combined with the content code of the second crop disease image, and it is stipulated that the cross combined image generated by the generator has visual authenticity.
[0020] As a preferred scheme of the crop disease transfer learning identification method for facility agriculture, the method further comprises:
[0021] The fourth constraint condition is that the image reconstructed by the content code and the first style code is encoded again, and it is stipulated that the new content code and the new style code obtained by the re-encoding are consistent with the original content code and the first style code respectively.
[0022] As a preferred scheme of the crop disease transfer learning identification method for facility agriculture, the method further comprises:
[0023] The fifth constraint condition is that the illumination environment image in the second image set is encoded into a second style code, and it is required that the first style code extracted from the crop disease image and the second style code extracted from the illumination environment image are consistent under the same illumination environment.
[0024] As a preferred scheme of the crop disease transfer learning identification method for facility agriculture, the generator in the decoupling generation network further comprises a feature style injection mechanism:
[0025] The intermediate content feature map obtained by decoding the content code is statistically normalized;
[0026] The normalized intermediate content feature map is scaled and biased by using the affine transformation parameters generated by the defined standard illumination style code, and the style information represented by the input style code is injected into the intermediate content feature map.
[0027] As a preferred scheme of the crop disease transfer learning identification method for facility agriculture, the step of defining the standard illumination style code is:
[0028] One or more illumination environment feature images under ideal illumination conditions are selected from the second image set, and the style code of the illumination environment feature image is extracted through the encoder in the decoupling generation network;
[0029] If multiple illumination environment feature images are selected, the style codes of the multiple illumination environment feature images extracted are averaged.
[0030] As a preferred scheme of the crop disease transfer learning identification method for facility agriculture, the method further comprises:
[0031] selecting a deep neural network pre-trained on a general image dataset as a basic framework of the crop disease recognition model;
[0032] fine-tuning the basic framework by using the normalized disease dataset.
[0033] Compared with the prior art, the application has the following beneficial effects:
[0034] 1. The application solves the problem of domain drift caused by light changes from the root by constructing a decoupling generation network, unifying the light style information irrelevant to disease diagnosis but extremely strong in interference in the crop disease image to a standard light, so that the recognition model can focus on learning the essential features of the disease, thereby maintaining the recognition accuracy of the model while having stability when facing various complex and unknown actual light environments in facility agriculture.
[0035] 2. By constructing a normalized dataset, the original images from any light condition can be uniformly converted to the same standard light reference, breaking the information barrier caused by different light environments, so that the datasets collected at different times and different places have compatibility, thereby improving the reuse value of the model and the utilization efficiency of the data. BRIEF DESCRIPTION OF DRAWINGS
[0036] In order to more clearly illustrate the technical solutions of the embodiments of the application, the following will briefly introduce the drawings needed to be used in the embodiment description. Obviously, the drawings in the following description are only some embodiments of the application, and for those skilled in the art, other drawings can be obtained without creative labor based on these drawings. Among them:
[0037] Figure 1 The overall flowchart of the crop disease transfer learning recognition method for facility agriculture according to an embodiment of the application. DETAILED DESCRIPTION
[0038] In order to make the above-mentioned purposes, features and advantages of the application more apparent and easy to understand, the specific embodiments of the application will be described in detail below with reference to the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the application, rather than all the embodiments. Based on the embodiments in the application, all other embodiments obtained by those skilled in the art without creative labor should be within the scope of protection of the application.
[0039] In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. However, it will be apparent to one skilled in the art that the present application can be practiced without the specific details set forth in this description. In other instances, well-known methods, procedures, components, and circuits have not been described in detail so as not to unnecessarily obscure aspects of the present application.
[0040] Secondly, the "one embodiment" or "an embodiment" referred to herein means containing a specific feature, structure, or characteristic in at least one implementation of the present application. The "in one embodiment" appearing in different places in the specification does not mean the same embodiment, nor is it an embodiment that is independent of or mutually exclusive with other embodiments.
[0041] The present application is described in detail below with reference to the accompanying drawings. In describing the embodiments of the present application, the cross-sectional view of the device structure is partially enlarged without the general proportion for the convenience of illustration, and the schematic view is only an example, which should not limit the scope of protection of the present application herein. In addition, the three-dimensional spatial dimensions of length, width and depth should be included in actual production.
[0042] Meanwhile, in the description of the present application, it should be noted that the terms "upper, lower, inner and outer" and the like indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the devices or elements referred to must have a particular orientation, be constructed and operated in a particular orientation, and therefore cannot be understood as a limitation on the present application. In addition, the terms "first, second or third" are only for descriptive purposes and cannot be understood as indicating or implying relative importance.
[0043] Unless otherwise specifically defined and limited, the terms "mounting, connecting, and connecting" in the present application should be broadly understood, for example: it can be fixedly connected, detachably connected or integrally connected; it can also be mechanically connected, electrically connected or directly connected, it can also be indirectly connected through an intermediate medium, or it can be the internal communication of two elements. For those skilled in the art, the specific meaning of the above terms in the present application can be understood according to the specific circumstances.
[0044] Embodiment 1
[0045] Reference Figure 1 For the first embodiment of the present application, the embodiment provides a crop disease migration learning identification method for facility agriculture, comprising:
[0046] S1, creating a pre-trained decoupling generation network, encoding the crop disease image, extracting the content code of the image pathological features, and separating the disease image into content code and style code through the decoupling generation network;
[0047] It should be noted that the pre-training decoupling generation network used in the present application is a variant based on a generative adversarial network, for example, CycleGAN, StarGAN, which mainly consists of three core components: a content encoder, a style encoder and a generator.
[0048] Specifically, the content encoder is a deep convolutional neural network, which aims to receive an input crop disease image and compress it into a compact feature vector, i.e., a content code; the neural network structure of the encoder includes several convolutional layers and down-sampling layers (pooling layers), which gradually extract high-level semantic information of the crop disease image, while being trained to actively ignore low-level style features such as texture, color and illumination, to capture illumination-invariant essential pathological structure and morphological information.
[0049] Specifically, the style encoder, like the content encoder described above, is a deep convolutional neural network, and its target is opposite to that of the content encoder; by receiving an input crop disease image, it is mapped to another feature vector, i.e., a style code, which is used to encapsulate global statistical features of the image, such as color temperature, brightness distribution, contrast and shadow pattern, etc.
[0050] Specifically, the generator receives the content code and the style code as input, and through several (at least one layer) up-sampling layers (pixel recombination) and convolutional layers, decodes and fuses the content code and the style code into a new image.
[0051] It should be noted that the architecture of the content encoder and the style encoder is a residual network, which includes an initial convolutional layer and multiple residual blocks, and uses convolutional layers with a step size of 2 for down-sampling, and finally outputs a content code or a style code of a specified dimension through a global average pooling layer and a fully connected layer; accordingly, the architecture of the generator is a reverse residual network, which receives the content code and the style code, and through several up-sampling layers (such as transposed convolution or pixel recombination) and residual blocks integrated with adaptive instance normalization, gradually restores the crop disease image to the original image size.
[0052] Further, the generator also integrates an efficient feature style injection mechanism, which is specifically adaptive instance normalization, and its workflow is as follows:
[0053] S101, the generator generates several intermediate content feature maps using the content code during the decoding process.
[0054] S102, for each intermediate content feature map, first perform instance normalization on it, i.e., independently normalize the mean and variance in each channel.
[0055] It should be noted that the process of instance normalization erases the original style information in the intermediate content feature map, and only the spatial structure is retained;
[0056] S103, meanwhile, the input style code generates a pair of affine transformation parameters, i.e. a scaling factor and a bias factor, through a small feedforward network (such as a multilayer perceptron);
[0057] S104, the scaling factor and the bias factor are applied to the content feature map after instance normalization, i.e.
[0058] AdaIN(x,y)=γ(y)×(x-μ(x)) / σ(x)+β(y)
[0059] Wherein, AdaIN(x,y) represents instance normalization, γ(y) represents a scaling factor, μ(x) represents a mean, β(y) represents a bias factor, σ(x) represents a standard deviation, and variance μ(x) represents a mean; y represents a style code, and x represents a content code;
[0060] It should be noted that through the above workflow, the illumination style represented by the style code is "injected" into the content feature map, and the generator can ensure that the finally generated image completely follows the style of the input style code by stacking multiple AdaINs;
[0061] Preferably, the data set for training the decoupled generation network is an unpaired data set, and the unpaired data set has the advantages of not needing to take a photo under all illumination conditions in the same crop disease area, and greatly reducing the cost and difficulty of data collection;
[0062] Specifically, the disease domain image set includes crop images with disease labels taken under various different illumination conditions;
[0063] It should be noted that the illumination conditions in the image set should be as rich as possible, and cover all possible cases such as natural light, different spectrum LED fill light, strong light, weak light, shadow, etc.
[0064] Specifically, the illumination domain image set includes images reflecting the illumination environment of facility agriculture, which can not contain crops, such as empty background, wall, ground or specially placed gray card in the greenhouse;
[0065] Further, in order to enable the decoupled generation network to learn the expected decoupling ability, the application trains it end-to-end through a composite loss function (i.e. composed of a plurality of constraint conditions weighted summation);
[0066] Specifically, the constraint conditions are image reconstruction constraint, adversarial constraint, content style cross-reconstruction constraint, latent space consistency constraint and style guide constraint, respectively.
[0067] Furthermore, image reconstruction constraints: for any image x from the disease domain image set... A It requires the content code c of the image itself. A =E c (x A ) and style codes A =E s (x A The reconstructed image G(c) A ,s A It must be compared with the original image x A High consistency is ensured to guarantee that the encoder does not lose critical information during the encoding process;
[0068] Specifically, high consistency is achieved by calculating the L1 norm (the sum of absolute differences at the pixel level) between the reconstructed image and the original image:
[0069] L rec =∣∣G(E c (x A ),E s (x A ))-x A |1
[0070] Among them, L rec Represented as image reconstruction loss, E c Represented as a content encoder, E s It is represented as a style encoder, G represents the generator, and ||·||1 represents the L1 norm, also known as the mean absolute error.
[0071] Specifically, if L rec A large value for L indicates that the reconstructed image differs significantly from the original image, with severe information loss; if L... rec The value is very small (close to 0), which means that the reconstructed image is almost identical to the original image. This indicates that the encoder has successfully encapsulated all the information of the image into the content code and style code without loss, and the generator can restore it.
[0072] Furthermore, adversarial constraints are introduced: a discriminator network D is introduced to distinguish between real images and forged images generated by the generator. The generator's goal is to generate images that are as realistic as possible to deceive the discriminator network. The adversarial game between the generator and the discriminator network can be quantified by adversarial loss, i.e., for the reconstructed image G(c A ,s A The system performs a judgment to ensure the authenticity of the reconstructed image;
[0073] Specifically, the quantification of the adversarial loss is proportional to the negative logarithm of the probability that the discriminator network judges the reconstructed image to be a real image, which is expressed as follows:
[0074] L adv_rec adversarial loss c (x A ), E s (x A ))
[0075] wherein L adv_rec adversarial loss
[0076] Further, on the basis of the quantification of the adversarial loss, a content style cross-reconstruction constraint is introduced: the style cross-reconstruction image G(c A ,s B ) is discriminated (where s B comes from the image x B of the image set of the illumination domain), to ensure that even if the content code and the style code come from different sources, the generated image is still real and reliable;
[0077] Specifically, by the same reasoning, the content style cross-reconstruction is proportional to the negative logarithm of the probability that the discriminator network judges the cross-combination image to be a real image, which is expressed as follows:
[0078] L adv_cross content style cross-reconstruction loss c (x B ), E s (x A ))
[0079] wherein L adv_cross content style cross-reconstruction loss
[0080] Specifically, the discrimination loss term is composed of the above-mentioned adversarial loss and the content style cross-reconstruction loss:
[0081] L adv discrimination loss term adv_cross + L adv_rec
[0082] wherein L adv discrimination loss term
[0083] It should be noted that only by minimizing the L adv , the generator can continuously improve the visual authenticity of the generated image to meet the requirements of the adversarial constraint and the content style cross-reconstruction constraint;
[0084] Further, the latent space consistency constraint: for the reconstructed image G(cA ,s A Then, it is fed back into the encoder, which is required to extract the new content code c′. A =E c (G(c A ,s A )) and new style code s′ A =E s (G(c A ,s A )) must be compared with the original c separately A and s A Maintaining consistency, that is:
[0085] L latent =∣∣c A -c′ A ||1+||s A -s′ A |1
[0086] Among them, L latent This is represented as latent space consistency loss;
[0087] It should be noted that by using content and style cross-reconstruction constraints, the content code and style code can be forced to become a sufficient and necessary condition for image generation, so as to prevent the "leakage" of key image information between the two codes.
[0088] Furthermore, style-guided constraints: for images x acquired under the same lighting conditions A and x B The requirement is that the style codes extracted from the two images are similar in the latent space. The calculation method is highly consistent with the above, that is, the distance (L1 norm) between them is calculated as the loss term:
[0089] L style_anchor =∣∣s A -s B |1
[0090] Among them, L style_anchor This is represented as style-guided loss;
[0091] It should be noted that style guidance constraints provide a strong supervisory signal for the style encoder, which can guide the style encoder to focus on learning illumination features;
[0092] Furthermore, by minimizing the weighted sum of all the above constraints using a gradient descent optimization algorithm (such as Adam), the composite loss function is obtained:
[0093] L total =λ1×L rec +λ2×L adv +λ3×Llatent + λ4 x L style_anchor
[0094] Wherein, λ1, λ2, λ3, λ4 are weight coefficients corresponding to respective losses, the values of the coefficients are obtained through manual parameter tuning and ablation experiment (but usually do not exceed the range interval of [0, 10]), that is, a set of initial weight coefficients is set, and the generated network starts training, in the training process, whether the current weight coefficient setting is reasonable is judged by visualizing the generated results and monitoring the change curve of each loss value; for example, if the style conversion fails / has no obvious effect, it may be because L latent or L style_anchor The weight is too low, the network has not learned to decouple, and λ3 and λ4 need to be increased. In addition, in order to prove the necessity of a loss term, "ablation experiment" will be carried out on the basis of manual parameter tuning, that is, the corresponding loss weight coefficient is set to 0 one by one, and the degree of decline of the performance of the generated network is observed to verify the contribution of the loss term.
[0095] It should be noted that through the above pre-training, the finally obtained decoupled generation network has the ability to decompose any input crop disease image into internal pathological content and external illumination style;
[0096] S2, define a standard illumination style code, based on the extracted content code and the illumination style code, generate an illumination normalized standardized test image through the generator of the decoupled generation network;
[0097] Specifically, a constant and ideal illumination environment benchmark is created by defining a standard illumination style code, which will serve as a target to convert the style of all test crop disease images (i.e. original image x A ) into the target style;
[0098] Further, from the illumination domain image set in step S1, one or more illumination environment feature images taken under ideal illumination conditions are selected;
[0099] It should be noted that ideal illumination conditions can be assisted in judging by the statistical properties of the image in the present scheme, for example, the pixel intensity histogram of the ideal illumination image should present an approximate Gaussian distribution and be concentrated in the middle gray scale region (such as for an 8-bit image, usually concentrated in the range of 80-180), and the overall brightness variance of the image is small. In practice, ideal illumination can also be defined by an image taken using a gray card as a reference under a uniform light source with a standard color temperature (such as 5500K);
[0100] Further, the selected illumination environment feature image is input into the style encoder of the pre-trained decoupled generation network, and the style encoder outputs its corresponding style code by processing the image;
[0101] Specifically, if only one light environment feature image is selected, the style code extracted from the light environment feature image is directly defined as the standard light style code; if multiple light environment feature images are selected, the multiple style codes extracted are averaged (i.e. the average value is taken), and the style code after the averaging process is defined as the standard light style code;
[0102] It should be noted that by defining the standard light style code according to the number of images, the accidental deviation that may be caused by a single sample is eliminated;
[0103] Further, when receiving a crop disease image under an arbitrary light, first, the crop disease image is input into the content encoder of the pre-trained decoupled generation network, and the content code representing the pathological features is extracted;
[0104] It should be noted that the style code of the crop disease image itself is not needed at this time, because the current target needs to be replaced;
[0105] Further, the content code of the pathological features extracted in the previous step and the defined standard light style code are input into the generator of the pre-trained decoupled generation network;
[0106] Specifically, the feature style injection mechanism inside the generator starts to work at this time:
[0107] The generator first generates a number of intermediate content feature maps without style information in the decoding path according to the input content code with pathological features, and then generates a set of affine transformation parameters (i.e. scaling factors and bias factors) using the standard light style code, and applies the set of affine transformation parameters to the content feature map after instance normalization, thereby "drawing" the ideal light style onto the original disease content, and finally outputting a new crop disease image, i.e. the normalized standard test image under light normalization;
[0108] It should be noted that the normalized test image not only completely coincides with the original test image in terms of pathological content, but also unifies the light condition to the defined standard light style code in terms of visual style;
[0109] S3, based on the normalized test image, a normalized disease data set is constructed and the data set is trained, a pre-trained crop disease recognition model is created, the test image is input into the model, and the recognition result of the crop disease is output;
[0110] It should be noted that for the constructed normalized disease data set and the crop disease recognition model, an offline mode is adopted;
[0111] Further, traverse each original image in the disease domain image set, for each image, perform the light normalization operation in S2 step, that is:
[0112] Extract the content code of the pre-trained decoupling generation network through the content encoder of the pre-trained decoupling generation network;
[0113] Combine the content code with the defined standard light style code;
[0114] Generate the corresponding normalized test image through the generator;
[0115] Further, all newly generated normalized test images are collected, their respective original disease labels are retained (for example, the label of the original image is "tomato late blight", and the label of the generated normalized image is also "tomato late blight"), and the new set of images with consistent light and their labels are used as the normalized disease data set;
[0116] Further, the present application adopts a transfer learning method for model training:
[0117] Select a mature deep neural network architecture that has been fully pre-trained on a large general image data set (such as ImageNet) as the basic framework of the crop disease recognition model;
[0118] Specifically, a network structure with superior performance such as ResNet, EfficientNet or DenseNet can be selected;
[0119] It should be noted that such network structures are selected as the basic framework of the pre-trained model because they have already learned general and hierarchical visual features (such as edges, textures, shapes, and components) about images, and the existence of these existing knowledge has strong positive transfer value for recognizing specific patterns of crop diseases, thereby significantly reducing the demand for disease annotation data and accelerating the convergence process of model training;
[0120] In addition, due to different application scenarios, the above selected basic framework needs to be adapted and trained, specifically including:
[0121] Structural adjustment: remove the original top classification head of the basic framework designed for general classification tasks (such as 1000 classes of ImageNet);
[0122] Add new layers: graft one or more new, randomly initialized fully connected layers as a new top classification head on the basis of the original top classification head, and the number of final output neurons of the new classification head is set to be exactly the same as the total number of disease categories in the normalized disease data set of the present application (for example, N diseases plus 1 healthy category, then output N+1).
[0123] performing training: taking the normalized disease dataset as training data, performing end-to-end training on the adjusted crop disease recognition model, wherein, in the training process, the crop disease recognition model receives the normalized disease image as input, obtains a predicted disease class probability distribution through forward propagation, then calculates the difference between the predicted distribution and the true label through a loss function (cross-entropy loss function), and finally calculates the gradient and updates the network weights of the model using the back propagation algorithm and an optimizer (such as Adam or SGD), with the goal of minimizing the loss;
[0124] In addition, in the initial training phase of performing training, the weights of all pre-training layers in the basic framework are frozen, and only the newly added top classification head with random parameter initialization is trained to quickly adapt to the new classification task; in the subsequent training phase, part of the top convolutional layers (for example, the last few residual blocks of ResNet) of the basic framework are unfrozen, and the part of the top convolutional layers and the classification head are trained end-to-end using a learning rate smaller than the model initialization learning rate to prevent the pre-training weights from being destroyed;
[0125] It should be noted that after the above model is fine-tuned and trained until the performance of the model on the validation set reaches the preset indicators (such as accuracy, precision, and recall), the model training process is completed, and the pre-training completed crop disease recognition model is obtained at this time;
[0126] Specifically, when the model receives a new to-be-tested image, it is first preprocessed in exactly the same way as the training data, that is, the to-be-tested image is generated through the S1 step and the S2 step to generate a normalized to-be-tested image with normalized illumination; then the generated normalized to-be-tested image is input into the pre-trained crop disease recognition model, the model performs a forward propagation on the input normalized image, and finally outputs a probability score for all possible disease classes at the output layer, and selects the class with the highest probability score as the final crop disease recognition result and outputs it to the user or the downstream automatic control system.
[0127] Those skilled in the art will understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The solutions in the embodiments of the present application can be implemented in various computer languages, such as object-oriented programming languages Java and interpreted scripting language JavaScript.
[0128] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 means for functionally implementing the steps listed in the flowchart block or blocks.
[0129] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 means for functionally implementing the steps listed in the flowchart block or blocks.
[0130] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 means for functionally implementing the steps listed in the flowchart block or blocks.
[0131] While the preferred embodiments of the application have been described, additional variations and modifications can be employed by those skilled in the art. Therefore, the appended claims intend to cover all such modifications and variations as fall within the true spirit and scope of the application. Further, it is intended that each means + function claim set forth herein covers inter alia, their products, the corresponding structures for performing functions.
[0132] Obviously, numerous modifications and variations of the present application are possible in light of the above teachings. It is therefore to be understood that within the scope of the appended claims, the application can be practiced otherwise than as specifically described herein.
Claims
1.A method for crop disease transfer learning recognition for facility agriculture, characterized in that, The application relates to a method for creating a pre-trained crop disease recognition model. The method comprises the following steps: creating a pre-trained disentangled generative network, encoding a crop disease image, extracting a content code of a pathological feature of the image, and separating the disease image into the content code and a style code through the disentangled generative network; defining a standard light style code, generating a normalized standard test image under light normalization through a generator of the disentangled generative network based on the extracted content code and the light style code; 2.The facility farming-oriented crop disease transfer learning identification method of claim 1, wherein, constructing a normalized disease data set based on the normalized test image and training the data set to create a pre-trained crop disease recognition model, inputting the test image into the model, and outputting a recognition result of the crop disease. The pre-trained disentangled generative network and the pre-trained crop disease recognition model are obtained through the following steps: obtaining a first image set containing crop disease images under multiple light conditions and a second image set containing multiple light environment features; training the disentangled generative network; defining the standard light style code; using the trained disentangled generative network to convert each crop disease image in the first image set into a corresponding normalized disease image to construct the normalized disease data set; 3.The facility farming-oriented crop disease transfer learning identification method of claim 2, wherein, training the crop disease recognition model through the way of transfer learning based on the normalized disease data set. The disentangled generative network is trained through at least one constraint condition as follows: a first constraint condition: the content code and the first style code of the crop disease image are reconstructed to generate an image consistent with the original crop disease image; a second constraint condition: the image generated by the generator has visual authenticity; 4.The facility farming-oriented crop disease transfer learning identification method of claim 2, wherein, a third constraint condition: the first style code of the first crop disease image is cross combined with the content code of the second crop disease image, and the cross combined image generated by the generator has visual authenticity. Further comprising: 5.The facility farming-oriented crop disease transfer learning identification method of claim 2, wherein, a fourth constraint condition: the image reconstructed by the content code and the first style code is encoded again, and the new content code and the new style code obtained through the encoding are consistent with the original content code and the first style code respectively. Further comprising: 6.The facility farming-oriented crop disease transfer learning identification method of claim 1, wherein, a fifth constraint condition: the light environment images in the second image set are encoded into second style codes, and the first style code extracted from the crop disease image and the second style code extracted from the light environment image are required to be consistent under the same light environment. The generator in the disentangled generative network further comprises a feature style injection mechanism: statistical normalization is performed on an intermediate content feature map obtained by decoding the content code; 7.The facility farming-oriented crop disease migration learning identification method according to claim 2 or 6, wherein, scaling and biasing operations are performed on the normalized intermediate content feature map by using affine transformation parameters generated based on the defined standard light style code, and style information represented by the input style code is injected into the intermediate content feature map. The step of defining the standard light style code comprises the following steps: one or more light environment feature images under ideal light conditions are selected from the second image set, and a style code of the light environment feature image is extracted through an encoder in the disentangled generative network; if multiple light environment feature images are selected, the style codes of the multiple light environment feature images are averaged. 8.The facility farming-oriented crop disease transfer learning identification method of claim 2, wherein, The crop disease identification model is trained by means of transfer learning, and the method comprises the following steps: a deep neural network pre-trained on a general image dataset is selected as a basic framework of the crop disease identification model; the basic framework is fine-tuned by using the normalized disease dataset.