Rice disease recognition method and system based on pattern feature enhanced deep transfer network
The deep migration network is enhanced by style features, and the separable convolution and local fine-grained attention module is used, combined with local style perturbation generation and dynamic spatial transformation, the problem of degradation of the recognition performance of rice disease recognition technology under complex conditions is solved, achieving high accuracy and robust disease recognition.
Patent Information
- Application Number
- CN202510708236.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-29
- Publication Date
- 2025-08-08
- Estimated Expiration
- 2045-05-29
AI Technical Summary
In actual application, the existing rice disease recognition technology has insufficient generalization ability, poor style adaptability, and low cross-domain recognition accuracy. Especially under the influence of changes in image acquisition conditions, light differences, background noise interference and other factors, the performance has significantly deteriorated.
The style feature enhancement deep migration network is adopted, and by constructing the source domain sample set of rice disease images, a GoogLeNet model that can separate convolution and local fine-grained attention modules is introduced. Combined with the local fine-grained style perturbation generator and dynamic spatial transformation, a diversified style feature domain is generated, and a joint training mechanism of classification consistency, style reconstruction consistency and style diversity loss is adopted to optimize the classification model.
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 model, solves the problem of degradation of identification performance, and is suitable for intelligent disease identification tasks in diversified agricultural production environments.
Smart Images

Figure CN120236203B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of artificial intelligence and agricultural image recognition, and in particular relates to a rice disease recognition method and system using a style feature enhanced deep migration network. Background Art
[0002] Rice is one of the world's major food crops, and its production is directly related to global food security. However, rice is highly susceptible to diseases during its growth, such as rice blast, bacterial blight, and brown spot, which can seriously affect its yield and quality.
[0003] Traditional disease identification methods mainly rely on the experience of agricultural technicians or expert diagnosis, which is not only inefficient and costly, but also the accuracy of identification is greatly affected by human subjective factors.
[0004] In recent years, with the development of deep learning and computer vision technology, image-based automated disease recognition methods have become a research hotspot.
[0005] In related technologies, existing methods often assume that the distribution of images in the training set and the test set is consistent (i.e., the independent and identically distributed assumption). However, in real scenarios, factors such as image acquisition equipment, lighting, background, and variety often lead to large differences in image styles, causing the performance of the trained model to seriously degrade during actual deployment, making it difficult to promote and apply. In particular, under the influence of factors such as changes in image acquisition conditions, lighting differences, and background noise interference, traditional models face technical bottlenecks that significantly degrade their performance. Summary of the Invention
[0006] The purpose of the embodiments of the present invention is to provide a rice disease recognition method and system using 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 in current rice disease recognition technology in practical applications.
[0007] To achieve the above objectives, the present invention provides the following technical solutions.
[0008] An embodiment of the present invention provides a rice disease recognition method using a pattern feature enhanced deep transfer network, the rice disease recognition method comprising the following steps:
[0009] S1. Construct a source domain sample set of rice disease images;
[0010] S2. Build a classification model GoogLeNet. Introduce a local fine-grained attention module after each Inception module in the classification model GoogLeNet. 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 fine-grained local style perturbation and dynamic spatial transformation style enhancement processing on the source domain image, 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 pattern enhancement process of step S3 and the joint training process of 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 identified as the classification model GoogLeNet K The input is , and the output is the disease recognition result of rice image.
[0015] Furthermore, 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.
[0016] Furthermore, in step S3, the step of performing fine-grained local style perturbation on the source domain image includes:
[0017] Using encoder G E , local perception style perturbation module and decoder G D A fine-grained style perturbation generation module is constructed, where the input image x is mapped to a latent feature vector by the encoder and a local style perturbation is applied, which is expressed as:
[0018] ;
[0019] 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, 、 is local random noise, , n p represents the affine coefficient after mapping, is the stability constant;
[0020] The perturbed features are restored by the decoder to generate a preliminary style transformation image , Expressed as:
[0021] ;
[0022] Among them, G D represents the decoder, LAPP represents the local style perturbation module, G E represents the encoder; x represents the image, and n represents the random perturbation vector.
[0023] Furthermore, in step S3, the step of performing dynamic spatial transformation on the source domain image includes:
[0024] Based on the preliminary style image, a dynamic geometric transformation module is introduced and constructed, and the localization network is used to predict the affine parameters. The affine parameters are expressed as: ,in, represents the affine parameters, Represents a localized network, represents the generated preliminary style transformation image;
[0025] After affine transformation, the basic sampling grid is generated, and random perturbations are superimposed to form a dynamic grid, which can be expressed as: ,in, represents random perturbations, represents the base sampling grid, Represents a dynamic grid;
[0026] The final unseen style sample image is generated by dynamic grid resampling and is expressed as: ,in, represents an unseen style sample image, represents the generated preliminary style transformation image, Represents a dynamic grid, and Resample represents an 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 step of constructing an unseen style feature domain includes:
[0028] Based on the generator G, the source domain sample set is expanded to obtain the unseen style feature domain, which is expressed as:
[0029] ;in, 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, y i is the corresponding disease category label;
[0030] The mapping process of generator G is expressed as: ; Resample represents the image resampling operation based on the input image and the sampling grid, G D represents the decoder, LAPP represents the local 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 , dynamically adjust the weights of each loss item by learning adaptive 、 、 , and adopts a multi-stage style feature expansion and training iteration mechanism to continuously expand the unseen style feature domain;
[0032] Among them, the joint loss function Expressed as:
[0033] ;
[0034] in, represents the classification consistency loss, Represents the weight of 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] Classification consistency loss The ability to discriminate the categories of constrained generated samples is expressed as:
[0036] ;
[0037] in, is the cross entropy loss function, x represents the input source domain image, y represents the disease category label corresponding to image x, G(x,n) represents the perturbed image generated by the style perturbation generator G with image x and random perturbation vector n~N(0,1) as input, and GoogLeNet represents the deep neural network classification module for classification tasks;
[0038] Style reconstruction consistency loss It is used to constrain the semantic fidelity of the images before and after perturbation, expressed as:
[0039] ;
[0040] in, Represents an inverse generation module that is symmetrical in structure to the style perturbation generator and is used for image reconstruction; Represents 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 differences in the generated results under different disturbance noises, and is expressed as:
[0042] , ;
[0043] Among them, n1 and n2 represent two different random perturbation vectors, which are used to enhance style diversity. Represents a very small positive number used to prevent the denominator from being zero.
[0044] Furthermore, in each round of training of the synchronous optimization style feature perturbation generator G and the classification module GoogLeNet step, the current generator G is first used. k Extended sample set ; Then the sample set Fusion with historical sample sets to form training sets ; Where S represents the initial source domain sample set, Indicates that the generator G in the kth round of training k Based on the unseen style feature sample set obtained by expanding the source domain sample S, in S k Synchronously optimize the classification module GoogLeNet and the generator G k .
[0045] Another embodiment of the present invention provides a rice disease recognition system using a pattern feature enhanced deep transfer network. The rice disease recognition system includes the following modules:
[0046] The sample set construction module is used to construct the source domain sample set of rice disease images;
[0047] The classification model module is used to build the classification model GoogLeNet. A local fine-grained attention module is introduced after each Inception module in the classification model GoogLeNet. The improved GoogLeNet model is trained using the source domain sample set to obtain the classification module GoogLeNet.
[0048] The style enhancement module is used to randomly initialize the style feature perturbation generator G, perform style enhancement processing on the source domain image through fine-grained local style perturbation and dynamic spatial transformation, generate diverse unseen image samples, and construct an unseen style feature domain;
[0049] The training optimization module 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] Iterative training module is used to repeatedly perform the style enhancement process and the joint training process until the preset number of training rounds K is reached to obtain the classification model GoogLeNet for rice disease recognition K ;
[0051] Disease recognition module, which uses the rice image to be identified as the classification model GoogLeNet K The input is , and the output is the disease recognition result of rice image.
[0052] Compared with the prior art, the rice disease identification method and system using pattern feature enhanced deep migration network of the present invention have the following beneficial effects:
[0053] First, the classification model GoogLeNet of the present invention introduces separable convolution, local fine-grained attention module and cross-scale feature fusion attention mechanism, 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;
[0054] Second, the present invention proposes a style feature perturbation generation method based on a combination of fine-grained local style perturbation and dynamic spatial transformation. This method can expand the style distribution and spatial variation 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 reduced recognition performance due to changes in acquisition conditions, lighting differences, and increased background complexity.
[0055] Third, the present invention adopts a dynamic weighted joint training mechanism consisting of classification consistency loss, style reconstruction consistency loss, and style diversity enhancement loss. This can effectively suppress pattern collapse and semantic drift while improving sample diversity, ensuring high discriminability and diversity of generated samples, and further improving 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 as the training progresses, and can achieve a high rice disease classification accuracy even under low-labeled sample conditions. It has good practical deployment value and promotion and application potential, and is suitable for intelligent disease identification tasks in diversified 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 briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention.
[0058] Figure 1A flowchart for implementing the rice disease recognition method using a pattern feature enhanced deep migration network provided by the present invention;
[0059] Figure 2 Some examples of images used to construct the rice disease image source domain dataset for this invention;
[0060] Figure 3 The first stage of the pattern feature perturbation generator used in the present invention is Figure 2 Image result generated by performing local style perturbation on the source domain image;
[0061] Figure 4 The second stage of the pattern feature perturbation generator used in the present invention is Figure 2 Image result graph generated by dynamic spatial transformation of source domain image;
[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 This is a schematic diagram of the accuracy change curve of the model on the validation set during the training process of the present invention;
[0064] Figure 7 This is a structural block diagram of the rice disease recognition system based on the pattern feature enhanced deep migration network provided by the present invention. DETAILED DESCRIPTION
[0065] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, 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 intended to limit the present invention.
[0066] Current rice disease recognition technologies face challenges in practical applications, including insufficient generalization, poor style adaptability, and low cross-domain recognition accuracy. In particular, they face technical bottlenecks, such as significant degradation of model performance under factors such as varying image acquisition conditions, varying lighting, and background noise. To address these issues, the present invention provides a rice disease recognition method and system using a deep transfer network augmented with style features. The following describes the specific implementation of the invention in detail, with reference to specific examples.
[0067] Please refer to Figure 1 ,In one embodiment of the present invention, a rice disease recognition method using a pattern feature enhanced deep migration network is provided;
[0068] The rice disease identification method comprises the following steps:
[0069] S1. Construct a source domain sample set of rice disease images;
[0070] Specifically, in step S1, the common disease image samples of rice at different growth stages, such as rice blast, rice false smut, sheath blight, etc., are obtained by field collection and data enhancement. Figure 2 As shown; the present invention manually marks the diseased areas of image samples, unifies the image size and channel format, and performs color standardization on the images to generate standardized training sample sets and test sample sets for subsequent model training and evaluation;
[0071] S2. Build a classification model GoogLeNet. Introduce a local fine-grained attention module after each Inception module in the classification model GoogLeNet. 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 feature conditions. The trained model has the recognition ability under the original style conditions, which serves as the basis for subsequent enhanced training.
[0073] Preferably, in the GoogLeNet model provided in step S2, the convolution operation of the Inception module in 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 by the present invention replaces the convolution operation with separable convolution (Depthwise Separable Convolution), and replaces the standard convolution operation used in each branch of the Inception module (including 1×1, 3×3, and 5×5 conventional convolution branches) with separable convolution. The specific operations are as follows:
[0075] First, in each convolution branch, each input channel is independently convolved using Depthwise Convolution;
[0076] Subsequently, cross-channel feature integration is performed through Pointwise Convolution (i.e., 1×1 convolution);
[0077] After the replacement, the number of parameters in a single convolution operation can be reduced to about 1 / 8 of the original, while keeping the receptive field unchanged;
[0078] Furthermore, in step S2 of the present invention, a fine-grained local attention module is introduced into the constructed classification model GoogLeNet. Specifically, a fine-grained local attention module is added to the output of each Inception module. The specific operations are as follows:
[0079] Perform local perception on the feature map output at each scale, with a local receptive field of approximately 3×3 or 5×5;
[0080] A small convolutional network is used to predict local attention weights. The small convolutional network consists of two layers of 3×3 convolution and Sigmoid activation.
[0081] Multiply the local weight map with the corresponding feature map element by element to enhance the response to small-scale lesions, texture anomalies, and tiny color spots;
[0082] Furthermore, in step S2 of the present invention, a multi-scale feature fusion attention mechanism is introduced. Specifically, the cross-scale attention mechanism is introduced in the multi-scale feature fusion stage of the Inception module. The specific operations are as follows:
[0083] First, the feature maps of each scale (1×1, 3×3, 5×5 branch output) are channel-concatenated;
[0084] Then, a lightweight feature selection module (such as Squeeze-and-Excitation Block) is used to dynamically learn the importance weights of feature maps at each scale.
[0085] Finally, the features of different scales are weightedly fused according to the weights to form a unified output.
[0086] The classification model GoogLeNet of the present invention introduces separable convolution, local fine-grained attention module and cross-scale feature fusion attention mechanism, 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 The rice disease identification method provided in the embodiment of the present invention further includes the following steps:
[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 diverse unseen image samples, and construct an unseen style feature domain;
[0089] 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;
[0090] S5. Repeat the pattern enhancement process of step S3 and the joint training process of 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 identified as the classification model GoogLeNet K The input is , and the output is the disease recognition result of rice image.
[0092] Specifically, step S3 is the process of initializing the style feature perturbation generator G and generating unseen style feature samples. It generates diverse unseen style samples through local style perturbation and dynamic spatial transformation, and constructs the style feature domain.
[0093] In step S3, the step of performing fine-grained local style perturbation on the source domain image includes:
[0094] Using encoder G E , local perception style perturbation module and decoder G D A fine-grained style perturbation generation module is constructed, where the input image x is mapped to a latent feature vector by the encoder and a local style perturbation is applied, which is expressed as:
[0095] ;
[0096] in, is the local block feature, is the mean of the local block, is the standard deviation of the local block, 、 is local random noise, , represents the affine coefficient after mapping, is the stability constant;
[0097] The perturbed features are restored by the decoder to generate a preliminary style transformation image , 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 As shown, local changes in style features can be seen, which enhances the diversity of samples;
[0101] Figure 3 The present invention demonstrates samples after performing local style change processing on source domain image features through the encoder-local perceptual style perturbation (LAPP)-decoder structure. While maintaining the original semantic information, the local style features are significantly perturbed.
[0102] Furthermore, in step S3, the step of performing dynamic spatial transformation on the source domain image includes:
[0103] Based on the preliminary style image, a dynamic geometric transformation module is introduced and constructed, and the localization network is used to predict the affine parameters. The affine parameters are expressed as: ,in, represents the affine parameters, Represents a localized network, represents the generated preliminary style transformation image;
[0104] After affine transformation, the basic sampling grid is generated, and random perturbations are superimposed to form a dynamic grid, which can be expressed as: ,in, represents random perturbations, represents the base sampling grid, Represents a dynamic grid;
[0105] As a preference, random perturbations is the Gaussian disturbance term;
[0106] Then, the final unseen style sample image is generated by dynamic grid resampling, which is expressed as: ,in, represents an unseen style sample image, represents the generated preliminary style transformation image, Represents a dynamic grid. Resample represents an image resampling operation based on the input image and the sampling grid. It is used to map each pixel in the original image to the target position according to the position of the sampling grid, thereby achieving geometric transformations (such as rotation, scaling, and translation).
[0107] Furthermore, in step S3, the step of constructing an unseen style feature domain includes:
[0108] Based on the generator G, the source domain sample set is expanded to obtain the unseen style feature domain, which is expressed as: ;in, : represents the original source domain sample set, x i is the source image, y iis the corresponding disease category label;
[0109] The mapping process of generator G is expressed as: ; Resample represents the image resampling operation based on the input image and the sampling grid, G D represents the decoder, LAPP represents the local perturbation module, represents the dynamic grid, and x represents the input source domain image;
[0110] like Figure 4 As shown in Figure 3, the generated images show obvious diversity in style features, but still maintain semantic consistency, constituting an unseen style feature domain dataset. Figure 4 It shows that based on the preliminary style perturbation, the dynamic geometric change samples obtained after predicting the affine parameters through the localization network and sampling the grid perturbation further enrich 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. It can expand the style distribution and spatial variation range of samples without destroying the semantic consistency of the image, thereby effectively improving the model's adaptability to unseen style domain images, and solving the problem of decreased recognition performance due to 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, in order to improve the recognition performance of the classification model under multi-style samples while maintaining 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. , dynamically adjust the weights of each loss item by learning adaptive 、 、 , the weights of each loss item can be dynamically adjusted to control the training direction; among them:
[0114] Classification consistency loss The ability to discriminate the categories of constrained generated samples is expressed as:
[0115] ;
[0116] in, is the cross entropy loss function, x represents the input source domain image, y represents the disease category label corresponding to image x, and G(x,n) represents the image x and the random perturbation vector As input, the perturbed image generated by the style perturbation generator G, GoogLeNet represents the deep neural network classification module for classification tasks;
[0117] Style reconstruction consistency loss It is used to constrain the semantic fidelity of the images before and after perturbation, expressed as:
[0118] ;
[0119] in, represents an inverse generation module that is symmetrical with the style perturbation generator structure and is used for image reconstruction. represents the L2 norm, which is used to measure 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 n~N(0,1) as input;
[0120] Style Diversity Enhancement Loss , which is used to encourage the differences in the generated results under different disturbance noises, and is expressed as:
[0121] ;
[0122] in, represents the L2 norm, n1 and n2 represent two different random perturbation vectors, which are used to enhance style diversity. Represents a very small positive number used to prevent the denominator from being zero.
[0123] In this embodiment of the present invention, the joint loss function Expressed as:
[0124] ;
[0125] in, represents the classification consistency loss, Represents the weight of 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 joint training mechanism consisting of classification consistency loss, style reconstruction consistency loss and style diversity enhancement loss. It can effectively suppress pattern collapse and semantic drift while improving sample diversity, ensuring the high discriminability and diversity of generated samples, and further improving the cross-domain recognition robustness of the classification model.
[0127] Furthermore, the joint training strategy of the present invention adopts a multi-stage style feature expansion and training iteration mechanism to continuously expand the domain of unseen style features. By continuously generating rich, diverse, safe and reliable style feature samples, the style space coverage of the training data is gradually improved, and the cross-style generalization ability and fine-grained feature discrimination performance of the classification model are simultaneously optimized.
[0128] In each training round:
[0129] Use the current generator G k Extended sample set ;
[0130] Combined with the historical sample set to form the training set S k , ;
[0131] Among them, S represents the initial source domain sample set, Indicates that the generator G in the kth round of training k Unseen style feature sample set obtained by expanding the source domain sample S;
[0132] In S k Synchronously optimize the classification module GoogLeNet and the generator G k ;
[0133] Finally, the model achieves robust recognition capabilities for multi-style images through joint loss optimization and style space expansion.
[0134] The present invention adopts a multi-stage style feature expansion and iterative training mechanism, dynamically enriching the unseen style feature domain as the training progresses. It can achieve a high rice disease classification accuracy even under low-label sample conditions. It has good practical deployment value and promotion and application potential, and is suitable for intelligent disease recognition tasks in diversified agricultural production environments.
[0135] In step S5 provided in the embodiment of the present invention, the style enhancement and joint training process is repeated to generate a final model;
[0136] Specifically, the style enhancement and joint training process described in steps 3 to 4 is repeated until the preset number of training rounds K is reached, and finally the trained classification model GoogLeNet is obtained. K During the training process, the joint loss function value and accuracy change curve are as follows: Figure 5 、 Figure 6 As shown, it shows that the model training converges well and the accuracy improves steadily;
[0137] Figure 5The trend of the weighted combined loss of classification consistency loss, style reconstruction consistency loss, and style diversity enhancement loss over the number of training iterations during multi-stage training is plotted, verifying the stability and convergence of the training process.
[0138] Figure 6 The accuracy of the classification model on the validation set steadily improved as the training iterations progressed, indicating that the proposed method effectively improved the classification performance and prevented overfitting.
[0139] Furthermore, based on the final model, the present invention conducted a prediction evaluation on a test set of rice disease images. The relevant performance indicators (including precision, recall, F1 score, etc.) are shown in Table 1, which demonstrates the excellent recognition effect and generalization performance of the method of the present invention in practical applications.
[0140] Table 1 Evaluation index results
[0141]
[0142] Table 1 shows the performance indicators of the final model on an independent test set, including accuracy, recall, and F1 score, which demonstrates the excellent recognition effect and cross-style generalization ability of the method in this paper under complex and multi-style conditions.
[0143] Please refer to Figure 7 In another embodiment of the present invention, a rice disease recognition system based on pattern feature enhanced deep transfer network is provided. The rice disease recognition system includes the following modules:
[0144] A sample set construction module 101 is used to construct a source domain sample set of rice disease images;
[0145] A classification model module 102 is used to construct a classification model GoogLeNet. A local fine-grained attention module is introduced after each Inception module in the classification model GoogLeNet. The improved GoogLeNet model is trained using a source domain sample set to obtain the classification module GoogLeNet.
[0146] The style enhancement module 103 is used to randomly initialize the style feature perturbation generator G, perform style enhancement processing on the source domain image through fine-grained local style perturbation and dynamic spatial transformation, generate diverse unseen image samples, and construct an unseen style feature domain;
[0147] The training optimization module 104 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;
[0148] Iterative training module 105 is used to repeatedly perform the pattern enhancement process and the joint training process until a preset number of training rounds K is reached to obtain the classification model GoogLeNet for rice disease recognition K ;
[0149] Disease identification module 106, used to use the rice image to be identified as a classification model GoogLeNet K The input is , and the output is the disease recognition result of rice image.
[0150] In one embodiment, the present invention proposes a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the rice disease identification method using the style feature enhanced deep migration network are implemented.
[0151] It should be understood that, although the various steps in the flow chart of each embodiment of the present invention are shown in sequence according to the indication of the arrows, these steps are not necessarily performed in sequence according to the order indicated by the arrows. Unless otherwise specified herein, the execution of these steps is not strictly limited in order, and these steps can be performed in other orders. Moreover, at least a portion of the steps in each embodiment may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these sub-steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with at least a portion of other steps or sub-steps or stages of other steps.
[0152] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing the relevant hardware through a computer program. The program can be stored in a non-volatile computer-readable storage medium. When executed, the program can include the processes of the above-described method embodiments. Any reference to memory, storage, database, or other media used in the various embodiments provided herein may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may 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 (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct RAMbus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM).
[0153] The technical features of the above-mentioned embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above-mentioned embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0154] The above-described embodiments merely illustrate several implementations of the present invention, and while their descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art would be able to make numerous variations and improvements without departing from the spirit of the present invention, all of which fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be determined by the appended claims.
[0155] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A rice disease recognition method based on pattern feature enhanced deep migration network, characterized by: The rice disease identification method comprises the following steps: S1. Construct a source domain sample set of rice disease images; S2. Build a classification model GoogLeNet. Introduce a local fine-grained attention module after each Inception module in the classification model GoogLeNet. 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 fine-grained local style perturbation and dynamic spatial transformation style enhancement processing on the source domain image, generate diverse unseen image samples, and construct an unseen style feature domain; Among them, the encoder G is used E , local perception style perturbation module and decoder G D A fine-grained style perturbation generation module is constructed. The input image x is mapped to a latent feature vector by an encoder, and local style perturbations are applied. The perturbed features are then restored by a decoder to generate a preliminary style-transformed image. Based on this preliminary style-transformed image, a dynamic geometric transformation module is introduced and constructed, using a localization network to predict affine parameters. After the affine transformation, a basic sampling grid is generated, and random perturbations are superimposed to form a dynamic grid. The final unseen style sample image is generated by resampling the dynamic grid. 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 pattern enhancement process of step S3 and the joint training process of 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 identified as the classification model GoogLeNet K The input is , and the output is the disease recognition result of rice image.
2. The rice disease recognition method based on pattern 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 based on pattern feature enhanced deep transfer network according to claim 2, characterized in that: In step S3, the encoder G is used E , local perception style perturbation module and decoder G D A fine-grained style perturbation generation module is constructed, where the input image x is mapped to a latent feature vector by the encoder and a local style perturbation is applied, which is 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, 、 is local random noise, , represents the affine coefficient after mapping, is the stability constant; Preliminary style transfer image Expressed as: Among them, G D represents the decoder, LAPP represents the local style perturbation module, G E represents the encoder; x represents the image, and n represents the random perturbation vector.
4. The rice disease identification method using pattern feature enhanced deep transfer network according to claim 3, characterized in that: In step S3, the step of constructing the unseen style feature domain includes: Based on the generator G, the source domain sample set is expanded to obtain the unseen style feature domain, which is expressed as: ;in, 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, y i is the corresponding disease category label.
5. The rice disease recognition method using pattern feature enhanced deep transfer network according to claim 4, characterized in that: In the joint training strategy of step S4, a dynamic weighted joint loss function is constructed , dynamically adjust the weights of each loss item by learning adaptive 、 、 , and adopts a multi-stage style feature expansion and training iteration mechanism to continuously expand the unseen style feature domain; Among them, the joint loss function Expressed as: ; in, represents the classification consistency loss, Represents the weight of 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 It is used to constrain the semantic fidelity of the images before and after perturbation, expressed as: ; in, Represents an inverse generation module that is symmetrical in structure to the style perturbation generator and is used for image reconstruction; Represents the L2 norm, which is used to measure the Euclidean distance between vectors or images; G(x,n) represents the image x and the random perturbation vector As input, the perturbed image generated by the style perturbation generator G; Style Diversity Enhancement Loss , which is used to encourage the differences in the generated results under different disturbance noises, and is expressed as: , ; Among them, n1 and n2 represent two different random perturbation vectors, which are used to enhance style diversity. Represents a very small positive number used to prevent the denominator from being zero.
6. The rice disease recognition method using pattern feature enhanced deep transfer network according to claim 5, characterized in that: In each round of training of the synchronous optimization style feature perturbation generator G and the classification module GoogLeNet step, the current generator G is first used. k Extended sample set ; Then the sample set Combined with the historical sample set to form the training set S k , ; Where S represents the initial source domain sample set, Indicates that the generator G in the kth round of training k Based on the unseen style feature sample set obtained by expanding the source domain sample S, in S k Synchronously optimize the classification module GoogLeNet and the generator G k .
7. An identification system for implementing the rice disease identification method using a pattern feature enhanced deep transfer network as claimed in any one of claims 1 to 6, characterized in that: The recognition system includes the following modules: The sample set construction module is used to construct the source domain sample set of rice disease images; The classification model module is used to build the classification model GoogLeNet. A local fine-grained attention module is introduced after each Inception module in the classification model GoogLeNet. The improved GoogLeNet model is trained using the source domain sample set to obtain the classification module GoogLeNet. The style enhancement module is used to randomly initialize the style feature perturbation generator G, perform style enhancement processing on the source domain image through fine-grained local style perturbation and dynamic spatial transformation, generate diverse unseen image samples, and construct an unseen style feature domain; The training optimization module 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; Iterative training module is used to repeatedly perform the style enhancement process and the joint training process until the preset number of training rounds K is reached to obtain the classification model GoogLeNet for rice disease recognition K ; Disease recognition module, which uses the rice image to be identified as the classification model GoogLeNet K The input is , and the output is the disease recognition result of rice image.
Citation Information
Patent Citations
Deep learning-based apple disease diagnosis method
CN113553972A