Paddy rice disease identification method and system based on style feature enhanced deep migration network
By introducing a style feature enhancement deep migration network in rice disease recognition technology, using local fine-grained attention modules and cross-scale feature fusion attention mechanisms, combining fine-grained local style perturbations and dynamic spatial transformation to generate diversified samples, the problems of insufficient generalization capabilities and low cross-domain recognition accuracy in the existing technology are solved, and higher recognition accuracy and robustness are achieved.
Patent Information
- Application Number
- CN202510708236.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-29
- Publication Date
- 2025-07-01
- Estimated Expiration
- 2045-05-29
AI Technical Summary
In actual application of existing rice disease recognition technology, there are problems such as insufficient generalization ability, poor style adaptability, and low cross-domain recognition accuracy. Especially under the influence of changes in image acquisition conditions, lighting differences, background noise interference and other factors, the model performance has significantly deteriorated.
Style feature enhancement deep migration network is adopted, and the local fine-grained attention module and cross-scale feature fusion attention mechanism are introduced by building an improved GoogLeNet model, and diversified unseen image samples are generated through fine-grained local style perturbations and dynamic spatial transformation, and the unseen style feature domain is constructed, and the style feature perturbation generator and classification module are optimized through joint training strategies.
It significantly improves the model's ability to extract fine-grained local disease characteristics and integrate cross-scale features, enhances the discriminant performance under complex background interference conditions, improves the accuracy and robustness of the basic model, solves the problem of low cross-domain identification accuracy, and is suitable for intelligent disease identification tasks in diversified agricultural production environments.
Smart Images

Figure CN120236203A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of artificial intelligence and agricultural image recognition, and particularly relates to a method and system for rice disease recognition based on a style feature enhanced deep transfer network. Background Art
[0002] Rice is one of the main food crops in the world, and its yield is directly related to global food security. However, during the growth process, rice is extremely vulnerable to disease attacks, such as rice blast, bacterial blight, brown spot disease, etc., which will seriously affect the yield and quality.
[0003] Traditional disease recognition methods mainly rely on the experience of agricultural technicians or expert diagnosis. They are not only inefficient and costly, but also greatly affected by human subjective factors in terms of recognition accuracy.
[0004] In recent years, with the development of deep learning and computer vision technologies, automated disease recognition methods based on images have become a research hotspot.
[0005] In related technologies, existing methods mostly assume that the image distributions of the training set and the test set are the same (i.e., the independent and identically distributed assumption). However, in real scenarios, factors such as image acquisition devices, lighting, background, and variety often lead to large differences in image styles, resulting in a significant decline in the performance of the trained model during actual deployment and making it difficult to promote and apply; especially under the influence of factors such as changes in image acquisition conditions, lighting differences, and background noise interference, traditional models have technical bottlenecks in which their performance significantly degrades. Summary of the Invention
[0006] The purpose of the embodiments of the present invention is to provide a method and system for rice disease recognition based on a style feature enhanced deep transfer network, aiming to solve the problems of insufficient generalization ability, poor style adaptability, and low cross-domain recognition accuracy existing in current rice disease recognition technologies during actual applications.
[0007] To achieve the above purpose, the present invention provides the following technical solutions.
[0008] An embodiment of the present invention provides a method for rice disease recognition based on a style feature enhanced deep transfer network. The rice disease recognition method includes the following steps:
[0009] S1. Construct a source domain sample set of rice disease images;
[0010] S2. Construct a classification model GoogLeNet, introduce a local fine-grained attention module after each Inception module in the classification model GoogLeNet, and use the source domain sample set to train the improved GoogLeNet model to obtain the classification module GoogLeNet;
[0011] S3. Randomly initialize the style feature perturbation generator G, perform style enhancement processing with fine-grained local style perturbation and dynamic spatial transformation on the source domain images, generate diverse unseen image samples, and construct an unseen style feature domain;
[0012] S4. Fuse the generated unseen image samples with the source domain samples, and synchronously optimize the style feature perturbation generator G and the classification module GoogLeNet through a joint training strategy;
[0013] S5. Repeat the style enhancement process in step S3 and the joint training process in step S4 until the preset number of training rounds K is reached, and obtain the classification model GoogLeNet for rice disease recognition K ;
[0014] S6. Use the rice image to be recognized as the input of the classification model GoogLeNet K and output the disease recognition result of the rice image.
[0015] Furthermore, in the GoogLeNet model provided in step S2, the convolutional operation in the Inception module of the classification model GoogLeNet is a separable convolution, and a cross-scale feature fusion attention mechanism is introduced in the fusion stage of the local fine-grained attention module.
[0016] Furthermore, in step S3, the steps for performing fine-grained local style perturbation on the source domain images include:
[0017] Adopt an encoder G E , a local perception style perturbation module and a decoder G D to construct a fine-grained style perturbation generation module. Among them, the input image x is mapped to a latent feature vector by the encoder, and local style perturbation is applied, which is expressed as:
[0018] ;
[0019] where LAPP represents the local style perturbation module, is the local block feature, is the mean of the local block, is the standard deviation of the local block, , is the local random noise, , n p represents the affine coefficient after mapping, is the stability constant;
[0020] The perturbed feature is restored by the decoder to generate a preliminary style transformation image , which is expressed as:
[0021] ;
[0022] Among them, G D represents the decoder, LAPP represents the local style perturbation module, and G E represents the encoder; x represents the image, and n represents the random perturbation vector.
[0023] Furthermore, in step S3, the steps of performing dynamic spatial transformation on the source domain image include:
[0024] Based on the preliminary style image, introduce and construct a dynamic geometric transformation module, and use the localization network to predict the affine parameters, which are expressed as: , where represents the affine parameters, represents the localization network, represents the generated preliminary style transformation image;
[0025] After the affine transformation, generate a basic sampling grid, superimpose random perturbations, and form a dynamic grid, which is expressed as: , where represents the random perturbation, represents the basic sampling grid, represents the dynamic grid;
[0026] Generate the final unseen style sample image through dynamic grid resampling, which is expressed as: , where represents the unseen style sample image, represents the generated preliminary style transformation image, represents the dynamic grid, and Resample represents the image resampling operation based on the input image and the sampling grid, which is used to map each pixel in the original image to the target position according to the position of the sampling grid.
[0027] Furthermore, in step S3, the steps of constructing the unseen style feature domain include:
[0028] Based on the generator G, expand the source domain sample set to obtain the unseen style feature domain, which is expressed as:
[0029] ; among them, represents the unseen style feature domain, G represents the generator; S represents the original source domain sample set, , x i is the source image, n represents the random perturbation vector, and y i is the corresponding disease category label;
[0030] The mapping process of the generator G is expressed as: ; where Resample represents the image resampling operation based on the input image and the sampling grid, G D represents the decoder, LAPP represents the local perception style perturbation module, represents the dynamic grid, and x represents the input source domain image.
[0031] Furthermore, in the joint training strategy of step S4, a dynamic weighted joint loss function is constructed , and the weights of each loss term are adaptively adjusted dynamically by learning , , , and a multi-stage style feature expansion and training iteration mechanism is adopted to continuously expand the unseen style feature domain;
[0032] Among them, the joint loss function is expressed as:
[0033] ;
[0034] Among them, represents the classification consistency loss, represents the weight of the classification consistency loss; represents the style reconstruction consistency loss, represents the weight of the style reconstruction consistency loss; represents the style diversity enhancement loss, represents the weight of the style diversity enhancement loss;
[0035] The classification consistency loss is used to constrain the class discrimination ability of the generated samples and is expressed as:
[0036] ;
[0037] Among them, is the cross-entropy loss function, x represents the input source domain image, y represents the disease class label corresponding to the image x, G(x,n) represents the perturbed image generated by the style perturbation generator G with the image x and the random perturbation vector n~N(0,1) as inputs, and GoogLeNet represents the deep neural network classification module for classification tasks;
[0038] The style reconstruction consistency loss is used to constrain the semantic fidelity of the image before and after perturbation and is expressed as:
[0039] ;
[0040] Among them, represents the inverse generation module symmetric to the structure of the style perturbation generator and is used for image reconstruction; Denotes the L2 norm, which is used to measure the Euclidean distance between vectors or images;
[0041] Style diversity enhancement loss , which is used to encourage the diversity of the generated results under different perturbation noises, and is expressed as:
[0042] , ;
[0043] where n1 and n2 represent two different random perturbation vectors for style diversity enhancement, denotes a very small positive number used to prevent the denominator from being zero.
[0044] Furthermore, in each round of training for synchronously optimizing the style feature perturbation generator G and the classification module GoogLeNet, first use the current generator G k to expand the sample set ; then fuse the sample set with the historical sample set to form the training set ; where S represents the initial source domain sample set, denotes the unseen style feature sample set expanded from the source domain sample S by the generator G in the k-th round of training, and synchronously optimize the classification module GoogLeNet and the generator G on S k k . k
[0045] Another embodiment of the present invention provides a rice disease recognition system for a style feature enhanced deep transfer network, and the rice disease recognition system includes the following modules:
[0046] Sample set construction module, which is used to construct the source domain sample set of rice disease images;
[0047] Classification model module, which is used to construct the classification model GoogLeNet, introduce a local fine-grained attention module after each Inception module in the classification model GoogLeNet, and use the source domain sample set to train the improved GoogLeNet model to obtain the classification module GoogLeNet;
[0048] Style enhancement module, which is used to randomly initialize the style feature perturbation generator G, perform style enhancement processing of fine-grained local style perturbation and dynamic spatial transformation on the source domain images, generate diverse unseen image samples, and construct an unseen style feature domain;
[0049] Training optimization module, which is used to fuse the generated unseen image samples with the source domain samples, and synchronously optimize the style feature perturbation generator G and the classification module GoogLeNet through a joint training strategy;
[0050] An iterative training module, which is used to repeatedly execute the style enhancement process and the joint training process until the preset number of training rounds K is reached, so as to obtain the classification model GoogLeNet for rice disease recognition. K ;
[0051] A disease recognition module, which is used to take the rice image to be recognized as the input of the classification model GoogLeNet K and output the disease recognition result of the rice image.
[0052] Compared with the prior art, the beneficial effects of the rice disease recognition method and system based on the style feature enhanced deep transfer network of the present invention are as follows:
[0053] First, the separable convolution, local fine-grained attention module and cross-scale feature fusion attention mechanism are introduced into the classification model GoogLeNet of the present invention, which significantly improves the model's ability to extract fine-grained local disease features and cross-scale feature integration, enhances the discriminant performance under the interference of complex backgrounds, and improves the accuracy and robustness of the basic model.
[0054] Second, the present invention proposes a style feature perturbation generation method based on the combination of fine-grained local style perturbation and dynamic spatial transformation, which can expand the style distribution and spatial change range of samples without destroying the semantic consistency of the image, thereby effectively improving the model's adaptability to images in unseen style domains and solving the problem of decreased recognition performance caused by changes in acquisition conditions, lighting differences, and increased background complexity.
[0055] Third, the present invention adopts a dynamic weighted joint training mechanism composed of classification consistency loss, style reconstruction consistency loss and style diversity enhancement loss, which can improve the sample diversity while effectively suppressing the mode collapse and semantic drift phenomena, ensure the high discriminability and diversity of the generated samples, and further improve the cross-domain recognition robustness of the classification model.
[0056] Fourth, the present invention adopts a multi-stage style feature expansion and iterative training mechanism, which dynamically enriches the unseen style feature domain with the progress of training, and can achieve a high rice disease classification accuracy even under the condition of low-annotated samples, has good practical deployment value and popularization and application potential, and is suitable for intelligent disease recognition tasks in diverse agricultural production environments. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention.
[0058] Figure 1Flowchart for implementing the rice disease recognition method using the style feature enhanced deep transfer network provided by the present invention;
[0059] Figure 2 Partial picture example diagram for constructing the source domain dataset of rice disease images in the present invention;
[0060] Figure 3 In the first stage of using the style feature perturbation generator in the present invention, for Figure 2 Image result diagram of local style perturbation generated for the source domain images in;
[0061] Figure 4 In the second stage of using the style feature perturbation generator in the present invention, for Figure 2 Image result diagram of dynamic spatial transformation generated for the source domain images in;
[0062] Figure 5 Schematic diagram of the change curve of the joint loss function during the training process of the present invention;
[0063] Figure 6 Schematic diagram of the change curve of the accuracy of the model on the validation set during the training process of the present invention;
[0064] Figure 7 Structure block diagram of the rice disease recognition system using the style feature enhanced deep transfer network provided by the present invention. Detailed implementation manners
[0065] In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0066] Problems such as insufficient generalization ability, poor style adaptability, and low cross-domain recognition accuracy exist in the current rice disease recognition technology in practical applications, especially the technical bottleneck that the model performance significantly degrades under the influence of factors such as changes in image acquisition conditions, lighting differences, and background noise interference. To solve the above problems, the present invention provides a rice disease recognition method and system using a style feature enhanced deep transfer network, and the specific implementation of the present invention will be described in detail below with reference to specific embodiments.
[0067] Please refer to Figure 1 , in an embodiment of the present invention, a rice disease recognition method using a style feature enhanced deep transfer network is provided;
[0068] The rice disease recognition method includes the following steps:
[0069] S1. Construct a source domain sample set of rice disease images;
[0070] Specifically, in step S1, common disease images of rice at different growth stages are obtained through field collection and data augmentation methods, such as rice blast, false smut, sheath blight, etc. Some image examples are as Figure 2 shown; in the present invention, the disease areas of the image samples are marked manually, the image sizes and channel formats are unified, and color standardization processing of the images is performed to generate a standardized training sample set and a test sample set for subsequent model training and evaluation;
[0071] S2. Construct a classification model GoogLeNet, introduce a local fine-grained attention module after each Inception module in the classification model GoogLeNet, and use the source domain sample set to train the improved GoogLeNet model to obtain the classification module GoogLeNet;
[0072] In the embodiment of the present invention, the constructed source domain sample set is used to train the classification model GoogLeNet to improve the recognition performance of the classification model GoogLeNet under the original style features. The trained model has the recognition ability under the original style conditions and serves as the basis for subsequent enhanced training;
[0073] Preferably, in the GoogLeNet model provided in step S2, the convolution operation in the Inception module of the classification model GoogLeNet is replaced with a separable convolution, and a cross-scale feature fusion attention mechanism is introduced in the fusion stage of the local fine-grained attention module;
[0074] Specifically, in step S2, the classification model GoogLeNet constructed in the present invention replaces the convolution operation with a separable convolution (Depthwise Separable Convolution), and replaces the standard convolution operations used in each branch (including 1×1, 3×3, 5×5 conventional convolution branches) in the Inception module with separable convolutions. The specific operation is as follows:
[0075] First, in each convolution branch, Depthwise Convolution is used to perform independent convolution on each input channel separately;
[0076] Subsequently, cross-channel feature integration is performed through Pointwise Convolution (i.e., 1×1 convolution);
[0077] After replacement, the number of parameters of a single convolution operation can be reduced to about 1 / 8 of the original, and at the same time, the receptive field can be kept unchanged;
[0078] Further, in step S2 of the implementation of the present invention, in the constructed classification model GoogLeNet, a Fine-grained Local Attention Module is introduced; specifically, a local fine-grained attention module is added to the output end of each Inception module, and the specific operation is as follows:
[0079] Perform local perception on the feature maps output at each scale, and the local receptive field range is approximately 3×3 or 5×5;
[0080] Use a small convolutional network to predict local attention weights, and the small convolutional network includes two layers of 3×3 convolution and Sigmoid activation;
[0081] Multiply the local weight map element-wise with the corresponding feature map to enhance the response to small-scale lesions, texture abnormalities, and tiny color patches;
[0082] Further, in step S2 of the implementation of the present invention, a Multi-scale Feature Fusion Attention mechanism is introduced; specifically, a cross-scale attention mechanism is introduced in the multi-scale feature fusion stage of the Inception module, and the specific operation is as follows:
[0083] First, perform channel splicing on the feature maps at each scale (output of the 1×1, 3×3, and 5×5 branches);
[0084] Then, through a lightweight feature selection module (such as Squeeze-and-Excitation Block), dynamically learn the importance weights of the feature maps at each scale;
[0085] Finally, perform weighted fusion on the features at different scales according to the weights to form a unified output.
[0086] The separable convolution, local fine-grained attention module, and cross-scale feature fusion attention mechanism are introduced into the classification model GoogLeNet of the present invention, which significantly improves the model's ability to extract fine-grained local disease features and integrate cross-scale features, enhances the discrimination performance under complex background interference conditions, and improves the accuracy and robustness of the basic model.
[0087] Please continue to refer to Figure 1 , in the rice disease recognition method provided by the embodiment of the present invention, the following steps are further included:
[0088] S3. Randomly initialize the style feature perturbation generator G, perform fine-grained local style perturbation and dynamic spatial transformation style enhancement processing on the source domain image, generate diversified unseen image samples, and construct an unseen style feature domain;
[0089] S4. Combine the generated unseen image samples with the source domain samples, and synchronously optimize the style feature perturbation generator G and the classification module GoogLeNet through a joint training strategy;
[0090] S5. Repeat the style enhancement process in step S3 and the joint training process in step S4 until the preset number of training rounds K is reached, and obtain the classification model GoogLeNet for rice disease recognition K ;
[0091] S6. Use the rice image to be recognized as the input of the classification model GoogLeNet K and output the disease recognition result of the rice image.
[0092] Specifically, step S3 is the process of initializing the style feature perturbation generator G and generating unseen style feature samples, and constructing the style feature domain by generating diverse unseen style samples through local style perturbation and dynamic spatial transformation;
[0093] In step S3, the steps of performing fine-grained local style perturbation on the source domain image include:
[0094] Adopt the encoder G E and the local perception style perturbation module and the decoder G D to construct a fine-grained style perturbation generation module. Among them, the input image x is mapped to a latent feature vector by the encoder, and local style perturbation is applied, expressed as:
[0095] ;
[0096] Among them, is the local block feature, is the mean of the local block, is the standard deviation of the local block, , is the local random noise, , represents the affine coefficient after mapping, is the stability constant;
[0097] The perturbed feature is restored by the decoder to generate a preliminary style transformation image , which is expressed as:
[0098] ;
[0099] Among them, G D represents the decoder, LAPP represents the local style perturbation module, G E represents the encoder; x represents the image;
[0100] The image after preliminary style perturbation is as follows Figure 3 shown, where it can be seen that local changes occur in the style features, enhancing the diversity of the samples;
[0101] Figure 3 It shows the samples after the local style change processing of the source domain image features by the encoder - local - aware style perturbation (LAPP) - decoder structure of the present invention. On the basis of maintaining the original semantic information, significant perturbations are achieved in the local style features.
[0102] Furthermore, in step S3, the steps of performing dynamic spatial transformation on the source domain image include:
[0103] On the basis of the preliminary style image, a dynamic geometric transformation module is introduced and constructed, and the affine parameters are predicted by the localization network. The affine parameters are expressed as: , where represents the affine parameters, represents the localization network, represents the generated preliminary style transformation image;
[0104] After the affine transformation, a basic sampling grid is generated, and a random perturbation is superimposed to form a dynamic grid, which is expressed as: , where represents the random perturbation, represents the basic sampling grid, represents the dynamic grid;
[0105] Preferably, the random perturbation is a Gaussian perturbation term;
[0106] Subsequently, the final unseen style sample image is generated by resampling through the dynamic grid, which is expressed as: , where represents the unseen style sample image, represents the generated preliminary style transformation image, represents the dynamic grid, and Resample represents the image resampling operation based on the input image and the sampling grid, which is used to map each pixel in the original image to the target position according to the position of the sampling grid, so as to achieve geometric transformation (such as rotation, scaling, translation, etc.).
[0107] Furthermore, in step S3, the steps of constructing the unseen style feature domain include:
[0108] Based on the generator G, the source domain sample set is expanded to obtain the unseen style feature domain, which is expressed as: ; where : represents the original source domain sample set, x i is the source image, y iIt is the corresponding disease category label;
[0109] The mapping process of the generator G is expressed as: ; where Resample represents the image resampling operation based on the input image and the sampling grid, and G D represents the decoder, LAPP represents the local perception style perturbation module, represents the dynamic grid, and x represents the input source domain image;
[0110] Such as Figure 4 shown, the generated images show obvious diversity in style features but still maintain semantic consistency, constituting a dataset of unseen style feature domains; Figure 4 shows the dynamic geometric change samples obtained by predicting the affine parameters and grid perturbation sampling via the localization network on the basis of the preliminary style perturbation, further enriching the spatial deformation characteristics of the training data.
[0111] The present invention proposes a style feature perturbation generation method based on the combination of fine-grained local style perturbation and dynamic spatial transformation, which can expand the style distribution and spatial change range of samples without destroying the semantic consistency of images, thereby effectively improving the adaptability of the model to images in unseen style domains and solving the problem of the decline in recognition performance caused by changes in acquisition conditions, lighting differences, and increased background complexity.
[0112] Furthermore, in step S4, the style perturbation module and the classification module are optimized through joint training;
[0113] Specifically, to improve the recognition performance of the classification model under multi-style samples and at the same time maintain the diversity and fidelity of style generation, a joint training strategy is adopted. In the joint training strategy, a dynamic weighted joint loss function is constructed , and the weights of each loss term are adaptively adjusted dynamically by learning , , . The weights of each loss term can be adjusted dynamically to control the training direction; where:
[0114] The classification consistency loss is used to constrain the class discrimination ability of the generated samples and is expressed as:
[0115] ;
[0116] Among them, is the cross-entropy loss function, x represents the input source domain image, y represents the disease category label corresponding to the image x, and G(x,n) represents the image x combined with the random perturbation vector As input, the perturbed image generated by the style perturbation generator G, where GoogLeNet represents the deep neural network classification module for classification tasks;
[0117] Style reconstruction consistency loss Used to constrain the semantic fidelity of the image before and after perturbation, expressed as:
[0118] ;
[0119] Where, Represents the inverse generation module symmetric to the structure of the style perturbation generator, used for image reconstruction, Represents the L2 norm, used to measure the Euclidean distance between vectors or images; G(x, n) represents the perturbed image generated by taking the image x and the random perturbation vector n~N(0, 1) as input and passing through the style perturbation generator G;
[0120] Style diversity enhancement loss , used to encourage the difference in generation results under different perturbation noises, expressed as:
[0121] ;
[0122] Where, Represents the L2 norm, n1, n2 represent two different random perturbation vectors, used for style diversity enhancement, Represents a very small positive number used to prevent the denominator from being zero.
[0123] In the embodiment of the present invention, the combined loss function Is expressed as:
[0124] ;
[0125] Where, Represents the classification consistency loss, Represents the weight of the classification consistency loss; Represents the style reconstruction consistency loss, Represents the weight of the style reconstruction consistency loss; Represents the style diversity enhancement loss, Represents the weight of the style diversity enhancement loss;
[0126] The present invention adopts a dynamic weighted combined training mechanism composed of classification consistency loss, style reconstruction consistency loss, and style diversity enhancement loss, which can effectively suppress the phenomena of mode collapse and semantic drift while improving the sample diversity, ensure the high discriminability and diversity of the generated samples, and further improve the cross-domain recognition robustness of the classification model.
[0127] Furthermore, in the joint training strategy of the present invention, a multi-stage style feature expansion and training iteration mechanism is adopted to continuously expand the unseen style feature domain. By continuously generating rich, diverse, safe, and reliable style feature samples, the style space coverage of the training data is gradually increased, and the cross-style generalization ability and fine-grained feature discrimination performance of the classification model are optimized synchronously;
[0128] In each round of training:
[0129] Use the current generator G k to expand the sample set ;
[0130] Fuse it with the historical sample set to form the training set S k , ;
[0131] where S represents the initial source domain sample set, represents the unseen style feature sample set expanded from the source domain sample S by the generator G k in the k-th round of training;
[0132] Synchronously optimize the classification module GoogLeNet and the generator G k on S k ;
[0133] Finally, under the joint loss optimization and style space expansion, the model achieves the robust recognition ability for multi-style images.
[0134] The present invention adopts a multi-stage style feature expansion and iterative training mechanism to dynamically enrich the unseen style feature domain as the training process progresses. It can achieve a high accuracy of rice disease classification even under the condition of low-annotated samples, has good practical deployment value and potential for popularization and application, and is applicable to the intelligent disease recognition task in diverse agricultural production environments.
[0135] In step S5 provided in the embodiment of the present invention, the style enhancement and joint training process are repeated to generate the final model;
[0136] Specifically, repeat the style enhancement and joint training process described in step 3 to step 4 until the preset number of training rounds K is reached, and finally obtain the trained classification model GoogLeNet K . During the training process, the change curves of the joint loss function value and the accuracy are as shown in Figure 5 , Figure 6 , indicating that the model training has good convergence and the accuracy is steadily improved;
[0137] Figure 5The trend of the combined loss value weighted by the classification consistency loss, style reconstruction consistency loss, and style diversity enhancement loss with the number of training iterations during the multi-stage training process is plotted, verifying the stability and convergence of the training process;
[0138] Figure 6 It shows the steady improvement trend of the accuracy of the classification model on the validation set as the training iterations progress, indicating that the method of the present invention effectively improves the classification performance and prevents overfitting;
[0139] Furthermore, based on the final model, the present invention conducts prediction and evaluation on the rice disease image test set, and the relevant performance indicators (including accuracy, recall, F1 score, etc.) are shown in Table 1, reflecting the excellent recognition effect and generalization performance of the method of the present invention in practical applications;
[0140] Table 1 Results Table of Evaluation Indicators
[0141]
[0142] Table 1 presents the performance indicators of the final model on the independent test set, including accuracy, recall, F1 score, etc., reflecting the excellent recognition effect and cross-style generalization ability of the method of the present invention under complex and diverse style conditions.
[0143] Please refer to Figure 7 , in another embodiment of the present invention, a rice disease recognition system for a style feature enhanced deep transfer network is provided. The rice disease recognition system includes the following modules:
[0144] A sample set construction module 101 for constructing a source domain sample set of rice disease images;
[0145] A classification model module 102 for constructing a classification model GoogLeNet, introducing a local fine-grained attention module after each Inception module in the classification model GoogLeNet, and training the improved GoogLeNet model with the source domain sample set to obtain the classification module GoogLeNet;
[0146] A style enhancement module 103 for randomly initializing a style feature perturbation generator G, performing style enhancement processing of fine-grained local style perturbation and dynamic spatial transformation on the source domain images, generating diverse unseen image samples, and constructing an unseen style feature domain;
[0147] A training optimization module 104 for fusing the generated unseen image samples with the source domain samples, and synchronously optimizing the style feature perturbation generator G and the classification module GoogLeNet through a joint training strategy;
[0148] The iterative training module 105 is configured to repeatedly execute the style enhancement process and the joint training process until the preset number of training rounds K is reached, so as to obtain the classification model GoogLeNet for rice disease recognition. K ;
[0149] The disease recognition module 106 is configured to use the rice image to be recognized as the input of the classification model GoogLeNet K and output the disease recognition result of the rice image.
[0150] In one embodiment, the present invention provides a computer device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the steps of the rice disease recognition method of the above-mentioned style feature enhanced deep transfer network are implemented.
[0151] It should be understood that although the steps in the flowcharts of the embodiments of the present invention are shown in sequence according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise clearly stated in this article, there is no strict order limit for the execution of these steps, and these steps can be executed in other orders. Moreover, at least a part of the steps in each embodiment may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed alternately or alternately with at least a part of other steps or sub-steps or stages of other steps.
[0152] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, storage, database, or other medium used in the embodiments provided in the present application can include non-volatile and / or volatile memories. Non-volatile memories can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memories can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and Rambus dynamic RAM (RDRAM), etc.
[0153] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.
[0154] The above embodiments merely represent several implementation manners of the present invention. The description is relatively specific and detailed, but it should not be construed as a limitation on the scope of the patent for the present invention. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present invention, several modifications and improvements can still be made, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the patent for the present invention should be subject to the appended claims.
[0155] The above is only the preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent replacements, and improvements made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for identifying rice diseases using a style feature enhanced deep transfer network, characterized in that, The rice disease recognition method includes the following steps: S1. Construct a source domain sample set of rice disease images; S2. Construct a classification model GoogLeNet, introduce a local fine-grained attention module after each Inception module in the classification model GoogLeNet, and use the source domain sample set to train the improved GoogLeNet model to obtain the classification module GoogLeNet; S3. Randomly initialize the style feature perturbation generator G, perform style enhancement processing of fine-grained local style perturbation and dynamic spatial transformation on the source domain images, generate diverse unseen image samples, and construct an unseen style feature domain; S4. Fuse the generated unseen image samples with the source domain samples, and synchronously optimize the style feature perturbation generator G and the classification module GoogLeNet through a joint training strategy; S5. Repeat the style enhancement process in step S3 and the joint training process in step S4 until the preset number of training rounds K is reached, and obtain the classification model GoogLeNet for rice disease recognition. K ; S6. Use the rice image to be recognized as the input of the classification model GoogLeNet K and output the disease recognition result of the rice image.
2. The rice disease recognition method using a style feature enhanced deep transfer network according to claim 1, characterized in that In the GoogLeNet model provided in step S2, the convolution operation of the Inception module in the classification model GoogLeNet is a separable convolution, and a cross-scale feature fusion attention mechanism is introduced in the fusion stage of the local fine-grained attention module.
3. The rice disease recognition method for enhancing the depth migration network according to the style feature described in claim 2, characterized in that In step S3, the steps for performing fine-grained local style perturbation on the source domain images include: Adopt encoder G E , local perception style perturbation module and decoder G D Construct a fine-grained style perturbation generation module, where the input image x is mapped to a latent feature vector by the encoder, and local style perturbation is applied, expressed as: ; Among them, LAPP represents the local style perturbation module, is the local block feature, is the mean of the local block, is the standard deviation of the local block, and is the local random noise, , represents the affine coefficient after mapping, is the stability constant; The perturbed features are restored by the decoder to generate a preliminary style transformation image , which is expressed as: ; Among them, G D represents the decoder, LAPP represents the local style perturbation module, and G E represents the encoder; x represents the image, and n represents the random perturbation vector.
4. The rice disease recognition method for enhancing the depth migration network according to the style feature described in claim 3, characterized in that, In step S3, the steps for performing dynamic spatial transformation on the source domain images include: On the basis of the preliminary style image, introduce and construct a dynamic geometric transformation module, and use the localization network to predict the affine parameters; After affine transformation, generate a basic sampling grid, superimpose random perturbations to form a dynamic grid; Generate the final unseen style sample image through dynamic grid resampling.
5. The rice disease recognition method for enhancing the depth migration network according to the style feature described in claim 4, characterized in that, In step S3, the steps for constructing the unseen style feature domain include: The source domain sample set is expanded based on the generator G to obtain the unseen style feature domain, which is expressed as: ; where represents the unseen style feature domain, G represents the generator; S represents the original source domain sample set, ; x i is the source image, n represents the random perturbation vector, and y i is the corresponding disease category label.
6. The rice disease recognition method for enhancing the depth transfer network according to the style feature of claim 5, characterized in that In the joint training strategy of step S4, a dynamic weighted joint loss function is constructed , and the weights of each loss term are adaptively adjusted dynamically by learning , , , and a multi-stage style feature extension and training iteration mechanism is adopted to continuously expand the unseen style feature domain; Among them, the combined loss function is expressed as: ; Among them, represents the classification consistency loss, represents the weight of the classification consistency loss; represents the style reconstruction consistency loss, represents the weight of the style reconstruction consistency loss; represents the style diversity enhancement loss, represents the weight of the style diversity enhancement loss; Style reconstruction consistency loss Used to constrain the semantic fidelity of the image before and after perturbation, expressed as: ; Among them, represents an inverse generation module symmetric to the style perturbation generator structure for image reconstruction; represents the L2 norm for measuring the Euclidean distance between vectors or images; G(x, n) represents the perturbed image generated by the style perturbation generator G with the image x and the random perturbation vector as inputs. Style diversity enhancement loss , which is used to encourage the differences in the generation results under different perturbation noises, is expressed as: , ; Among them, n1 and n2 represent two different random perturbation vectors, which are used for enhancing style diversity. represents a very small positive number used to prevent the denominator from being zero.
7. The rice disease recognition method using a style feature enhanced deep transfer network according to claim 6, characterized in that In each round of training for synchronously optimizing the style feature perturbation generator G and the classification module GoogLeNet, first use the current generator G k to expand the sample set ; then fuse the sample set with the historical sample set to form the training set S k , ; where S represents the initial source domain sample set, represents the unseen style feature sample set expanded by the generator G k based on the source domain sample S in the k-th round of training. Synchronously optimize the classification module GoogLeNet and the generator G k on S k .
8. An identification system for a rice disease identification method that implements a style feature enhanced deep migration network as described in any one of claims 1 to 7, characterized in that, The recognition system includes the following modules: A sample set construction module, which is used to construct a source domain sample set of rice disease images; A classification model module, which is used to construct a classification model GoogLeNet, introduce a local fine-grained attention module after each Inception module in the classification model GoogLeNet, and use the source domain sample set to train the improved GoogLeNet model to obtain the classification module GoogLeNet; A style enhancement module, which is used to randomly initialize the style feature perturbation generator G, perform style enhancement processing of fine-grained local style perturbation and dynamic spatial transformation on the source domain images, generate diverse unseen image samples, and construct an unseen style feature domain; A training optimization module, which is used to fuse the generated unseen image samples with the source domain samples, and synchronously optimize the style feature perturbation generator G and the classification module GoogLeNet through a joint training strategy; An iterative training module, which is used to repeatedly execute the style enhancement process and the joint training process until the preset number of training rounds K is reached, so as to obtain the classification model GoogLeNet for rice disease recognition K ; The disease recognition module is used to take the rice image to be recognized as the input of the classification model GoogLeNet K and output the disease recognition result of the rice image.
Citation Information
Patent Citations
Method and system for identifying white-leg shrimp disease on basis of machine vision
CN102521600A
Deep learning-based apple disease diagnosis method
CN113553972A
Rice leaf scab detection method based on deep learning
CN116012721A
Pest identification model updating method and device, pest identification method and device and electronic equipment
CN116958806A
Image classification using neural networks
WO2019238976A1
Cited By
Rice leaf disease identification method used in open scene
CN121482600A