Cotton verticillium wilt early detection method and system based on generative adversarial network
Through the early detection method of cotton verticillium worries based on the generative adversarial network, the hyperspectral image data is enhanced, the problem of scarcity of samples in cotton verticillium worries detection is solved, the detection effect is improved, and high accuracy and diversity are achieved.
Patent Information
- Application Number
- CN202411092999.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2024-11-22
AI Technical Summary
The number of training samples in early detection of cotton verticillium wilt is limited, resulting in poor detection results.
Adopt early detection method of cotton verticillium worries based on generative adversarial networks, and construct auxiliary classification generation adversarial network model COTTON_GAN, and use hyperspectral image data to enhance data, generate cotton verticillium worries samples similar to real data, so as to improve detection Effect.
It alleviates the problem of limited training samples, improves the accuracy and effectiveness of early detection of cotton verticillium wort, and the generated data have high similarity and diversity, enhancing the reliability and generalization ability of detection.
Smart Images

Figure CN119006412A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of crop disease diagnosis, and in particular to an early detection method and system for cotton Verticillium wilt based on a generative adversarial network. Background Art
[0002] Cotton is very susceptible to various diseases during its growth, especially Verticillium wilt caused by Verticillium dahliae, which is a disease that causes great damage to cotton. Since its introduction into my country, Verticillium wilt has frequently broken out and has become the most serious and widespread cotton disease. Therefore, the detection and prevention of cotton Verticillium wilt is imminent.
[0003] In recent years, hyperspectral imaging technology has been widely studied and practiced in the agricultural field due to its advantages such as non-destructive and rapid. Especially in the field of high-throughput plant phenotyping. And hyperspectral imaging technology, due to its continuous multi-band acquisition capability and high spectral resolution, can effectively highlight the characteristics of plants under early disease stress and become one of the key technologies for early detection of cotton Verticillium wilt. Although hyperspectral technology has great potential in plant phenotyping, it also faces the problem of limited number of training samples.
[0004] Generative adversarial network is a generative model based on adversarial learning framework, which is regarded as one of the most promising methods in the field of generative learning on complex data distribution in recent years. It uses adversarial training of generative model and discriminative model to learn and fit the distribution of real data, generate data with high similarity to real data, and alleviate the problem of sample scarcity in hyperspectral images from the perspective of data enhancement; secondly, as the model structure of generative adversarial network is continuously enriched and optimized, it can fully mine feature information and make up for the problem of not fully utilizing the feature information contained in hyperspectral images.
[0005] Therefore, a method and system for early detection of cotton Verticillium wilt based on generative adversarial networks are proposed. Starting from the hyperspectral phenotypic data of cotton, early detection of cotton Verticillium wilt is achieved. At the same time, combined with generative adversarial networks, the problem of limited training samples in hyperspectral image classification is solved, and the early detection effect of cotton Verticillium wilt is improved. This is a problem that technical personnel in this field urgently need to solve. Summary of the invention
[0006] In view of this, the present invention provides a method and system for early detection of cotton Verticillium wilt based on generative adversarial networks. Aiming at the problem of limited number of training samples in early detection of cotton Verticillium wilt based on hyperspectral imaging, a model and system for early detection of cotton Verticillium wilt based on generative adversarial networks data enhancement are constructed to alleviate the problem of limited number of training samples for early detection of cotton Verticillium wilt and improve the effect of early detection of cotton Verticillium wilt.
[0007] In order to achieve the above object, the present invention adopts the following technical solution:
[0008] A method for early detection of cotton Verticillium wilt based on a generative adversarial network comprises the following steps:
[0009] S1 hyperspectral image acquisition step: the sample on the day of the onset of the disease is the captured early cotton Verticillium wilt sample, and the hyperspectral image of the current cotton Verticillium wilt sample is captured to obtain the original hyperspectral image;
[0010] S2 preprocessing step: black and white calibration of the original hyperspectral image to remove noise;
[0011] S3 spectral data extraction steps: The complete cotton plant is defined as the region of interest (ROI), and a binary mask is created, where 0 represents the background and 1 represents the foreground cotton plant. The binary mask is applied to the calibrated hyperspectral image to obtain a hyperspectral image with the background removed. Then, the average value of the pixels in each channel is calculated to preliminarily obtain the cotton spectral curve with the background removed. At the same time, the standard normal variable transformation (SNV) is used to preprocess the cotton spectral curve with the background removed to obtain the preprocessed hyperspectral image data.
[0012] S4 Dataset division step: The preprocessed hyperspectral image data is divided according to the infection level, and the training set and test set in each infection level are divided according to the preset ratio;
[0013] S5 Network model construction steps: Auxiliary classification generation adversarial network model COTTON_GAN includes: generation model G, discrimination model D and classification model C;
[0014] S6 network model training steps: Initialize all weight matrices and biases of the generation model G, the discriminant model D, and the classification model C, input the training set, and calculate the discriminant loss L s and classification loss L c , fix the discriminant model D and the classification model C, and maximize L c +L s Update the weight matrix and bias of the generative model G; by maximizing L c -L s Update the weight matrix and bias of the discriminant model D and the classification model C; obtain the trained auxiliary classification generative adversarial network model COTTON_GAN;
[0015] S7 detection step: input the hyperspectral image of the cotton to be detected into the trained auxiliary classification generative adversarial network model COTTON_GAN to obtain the detection result.
[0016] The above method may, optionally, further include a sample preparation step before the step S1 of acquiring the hyperspectral image, the specific contents of which are as follows:
[0017] Two cotton varieties with different resistance to Verticillium wilt were selected, including Xinlu Zao 76 and Xinlu Zao 1, and soilless culture, i.e. hydroponic planting mode, was chosen for cotton planting.
[0018] In the above method, optionally, in the S2 preprocessing step, calibration is performed according to formula (1):
[0019]
[0020] Among them, I calibrated is the corrected image, I raw is the original hyperspectral image, I dark is the dark reflectance image with a reflectance of 0%, I white It is a white reflectance image with a reflectance of approximately 100%.
[0021] In the above method, optionally, in the S3 spectral data extraction step, the 458nm band of the hyperspectral sub-image taken by the camera is used as a reference, and the threshold is set to 0.02 to distinguish the foreground ROI and the background; the noise bands at both ends are eliminated, and the spectrum in the range of 405nm-1011nm is used for early detection of cotton wilt.
[0022] In the above method, optionally, in the S3 spectral data extraction step, the standard normal variable transformation SNV is used to preprocess the hyperspectral image data, as shown in formula (2):
[0023]
[0024] In the formula, x is a sample with m features. is the sample feature mean, n is the number of samples, and i means that the data of the i-th sample is currently being calculated.
[0025] In the above method, optionally, in the S4 data set division step, the division ratio is: the training set and the test set are divided in a ratio of 4:1.
[0026] In the above method, optionally, the discrimination loss L in the S6 network model training step is s and classification loss L c The calculation formula is as follows:
[0027] L s = E[logP(S = real | X real )]+E[logP(S=fake|X fake )] (3)
[0028] L c =E[logP(C=c|X real)]+E[logP(C=c|X fake )] (4)
[0029] Where E is the number of iterations, logP(S=real|X real ) is the real data X real The logarithmic probability of being judged as real, logP(S=fake|X fake ) is the generated data X fake The logarithmic probability of being judged as false, logP(C=c|X real ) is the real data X real The logarithmic probability of being classified as category c, logP(C=c|X fake ) is the generated data X fake The log probability of being classified as class c.
[0030] A cotton Verticillium wilt early detection system based on a generative adversarial network, executing any of the above-mentioned cotton Verticillium wilt early detection methods based on a generative adversarial network, comprising:
[0031] A hyperspectral image acquisition module is used to acquire a hyperspectral image of a cotton Verticillium wilt sample to obtain an original hyperspectral image;
[0032] The preprocessing module is used to perform black and white calibration on the original hyperspectral image to remove noise;
[0033] The spectral data extraction module is used to define the complete cotton plant as the region of interest (ROI) and create a binary mask, where 0 represents the background and 1 represents the foreground cotton plant. The binary mask is applied to the calibrated hyperspectral image to obtain a hyperspectral image with the background removed. Then, the average value of the pixels in each channel is calculated to preliminarily obtain the cotton spectral curve with the background removed. At the same time, the standard normal variable transformation (SNV) is used to preprocess the cotton spectral curve with the background removed to obtain the preprocessed hyperspectral image data.
[0034] A data set partitioning module is used to partition the preprocessed hyperspectral image data according to infection levels, and the training set and test set in each infection level are partitioned according to a preset ratio;
[0035] The network model building module is used to build the auxiliary classification generative adversarial network model COTTON_GAN, including: generation model G, discrimination model D and classification model C;
[0036] The network model training module is used to initialize all weight matrices and biases of the generation model G, the discriminant model D, and the classification model C, input the training set, and calculate the discriminant loss L s and classification loss L c , fix the discriminant model D and the classification model C, and maximize Lc +L s Update the weight matrix and bias of the generative model G; by maximizing L c -L s Update the weight matrix and bias of the discriminant model D and the classification model C; obtain the trained auxiliary classification generative adversarial network model COTTON_GAN;
[0037] The detection module is used to input the hyperspectral image of the cotton to be detected into the trained auxiliary classification generative adversarial network model COTTON_GAN to obtain the detection result.
[0038] It can be seen from the above technical solutions that, compared with the prior art, the present invention provides a method and system for early detection of cotton Verticillium wilt based on a generative adversarial network, which has the following beneficial effects:
[0039] 1) Enhance the data of early hyperspectral images of cotton Verticillium wilt from a spectral perspective to generate data with high similarity and diversity to the real data;
[0040] 2) In order to solve the problem of limited number of training samples in early detection of cotton Verticillium wilt based on hyperspectral imaging, a cotton Verticillium wilt early detection model and system based on generative adversarial network data enhancement was constructed to alleviate the problem of limited number of training samples for early detection of cotton Verticillium wilt and improve the effect of early detection of cotton Verticillium wilt. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0042] Figure 1 A flow chart of an early detection method for cotton Verticillium wilt based on a generative adversarial network disclosed in the present invention;
[0043] Figure 2 The present invention discloses a cotton planting flow chart;
[0044] Figure 3 This is a flow chart of hyperspectral data preprocessing disclosed in the present invention;
[0045] Figure 4 This is a structural diagram of the COTTON_GAN model disclosed in the present invention;
[0046] Figure 5 This is a functional architecture diagram of the system disclosed in the present invention;
[0047] Figure 6 The overall flow chart of the system disclosed in the present invention;
[0048] Figure 7 This is a diagram of the user login module interface disclosed in the present invention;
[0049] Figure 8 This is an interface diagram of the data segmentation module disclosed in the present invention;
[0050] Fig. 9 This is an interface diagram of the data processing module disclosed in the present invention;
[0051] Fig.10 This is an interface diagram of the early detection module disclosed in the present invention;
[0052] Fig.11 The generated spectrum and the real spectrum visualization disclosed in the present invention, wherein 11a to 11f are iterations 0, 100, 1000, 2000, 3000 and the real spectrum sample respectively;
[0053] Fig.12 is an objective measure of the similarity between the generated spectrum and the real spectrum disclosed in the present invention, wherein 12a is the RMSE value as an objective measure of sample similarity, and 12b is the MEAN value as an objective measure of sample similarity;
[0054] Fig.13 The distribution of the generated spectrum and the real spectrum disclosed in the present invention, wherein 13a to 13f are the spectrum distribution of the infected and healthy cotton in iterations of 0, 1500 and 3000 rounds respectively;
[0055] Fig.14 is an objective measure of the diversity of the generated spectrum and the real spectrum disclosed in the present invention, wherein 14a is the variance of the generated and real samples, and 14b is the standard deviation of the generated and real samples;
[0056] Fig.15 15a to 15d are the band contributions of RF, SVM, LSTM and COTTON_GAN respectively. DETAILED DESCRIPTION
[0057] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0058] In this application, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. The terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of more restrictions, the elements defined by the sentence "comprise one..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0059] See also Figure 1 As shown, the present invention discloses an early detection method for cotton Verticillium wilt based on a generative adversarial network, comprising the following steps:
[0060] S1 hyperspectral image acquisition step: the sample on the day of the onset of the disease is the captured early cotton Verticillium wilt sample, and the hyperspectral image of the current cotton Verticillium wilt sample is captured to obtain the original hyperspectral image;
[0061] Specifically, the hyperspectral data of cotton was collected: after the inoculation of Verticillium wilt pathogens, due to the differences in the disease conditions of each plant, in order to capture earlier cotton Verticillium wilt samples as much as possible, this experiment adopted a continuous shooting strategy, combined with the experience of agricultural experts and the national standard GB / T 22101 to identify each cotton plant until the cotton showed symptoms of Verticillium wilt, that is, to stop the subsequent shooting of the plant, and the sample on the day of the disease was the captured early cotton Verticillium wilt sample.
[0062] S2 preprocessing step: black and white calibration of the original hyperspectral image to remove noise;
[0063] S3 spectral data extraction steps: The complete cotton plant is defined as the region of interest (ROI), and a binary mask is created, where 0 represents the background and 1 represents the foreground cotton plant. The binary mask is applied to the calibrated hyperspectral image to obtain a hyperspectral image with the background removed. Then, the average value of the pixels in each channel is calculated to preliminarily obtain the cotton spectral curve with the background removed. At the same time, the standard normal variable transformation (SNV) is used to preprocess the cotton spectral curve with the background removed to obtain the preprocessed hyperspectral image data.
[0064] S4 Dataset division step: The preprocessed hyperspectral image data is divided according to the infection level, and the training set and test set in each infection level are divided according to the preset ratio;
[0065] S5 Network model construction steps: Auxiliary classification generation adversarial network model COTTON_GAN includes: generation model G, discrimination model D and classification model C;
[0066] S6 network model training steps: Initialize all weight matrices and biases of the generation model G, the discriminant model D, and the classification model C, input the training set, and calculate the discriminant loss L s and classification loss L c , fix the discriminant model D and the classification model C, and maximize L c +L s Update the weight matrix and bias of the generative model G; by maximizing L c -L s Update the weight matrix and bias of the discriminant model D and the classification model C; obtain the trained auxiliary classification generative adversarial network model COTTON_GAN;
[0067] S7 detection step: input the hyperspectral image of the cotton to be detected into the trained auxiliary classification generative adversarial network model COTTON_GAN to obtain the detection result.
[0068] Furthermore, before the S1 hyperspectral image acquisition step, a sample preparation step is also included, and the specific contents are as follows:
[0069] Two cotton varieties with different resistance to Verticillium wilt were selected, including Xinlu Zao 76 and Xinlu Zao 1, and soilless culture, i.e. hydroponic planting mode, was chosen for cotton planting.
[0070] Specifically, in order to increase the diversity of data samples and cover cotton with different levels of resistance to Verticillium wilt in this preparation step, two cotton varieties with different resistance to Verticillium wilt are selected, including Xinlu Zao 76 and Xinlu Zao 1, of which Xinlu Zao 76 is a disease-resistant variety and Xinlu Zao 1 is a susceptible variety. In order to reduce the influence of external factors and more accurately control the growth of cotton, the patent of the present invention selects soilless cultivation, i.e., hydroponic planting mode, for cotton planting. The location of hydroponic planting is located in the greenhouse laboratory of the College of Agriculture of Shihezi University (86°3′34″ east longitude, 44°18′58″ north latitude). The temperature range of the greenhouse is controlled between 20°C-30°C, the average temperature is about 25°C, the relative humidity range is controlled between 10%-50%, and the average relative humidity is about 30%. First, the cotton seeds are soaked in clean water for 2 hours and then screened, and filtered after the screening is completed. Stir and soak with 30% disinfectant for 20 minutes, pour out the disinfectant, filter, repeat the cleaning until clean, and darken it overnight. Select the cotton seeds again and put them into vermiculite, cover the cotton seeds with vermiculite, and control the thickness of the cover to 3cm-5cm. Expose them to sunlight for 8 hours a day and water them regularly to raise the seedlings. Transplant and hydroponically cultivate the cotton seedlings after 2-4 cotyledons appear. Figure 2The process of vermiculite seedling cultivation is shown. During hydroponics, the light is on for 12 hours a day, and water and an appropriate amount of nutrient solution are added on time every day. Among them, the hydroponic nutrient solution adopts the Hogland standard concentration nutrient solution formula, which is a universal standard nutrient solution for soilless cultivation. The specific formula is: 2.5ml / L iron salt solution, 115mg / L ammonium phosphate, 5ml / L trace elements, 493mg / L magnesium sulfate, 607mg / L potassium nitrate, pH=6.0, and then artificial soft water, i.e. distilled water, is used for preparation. The growth of cotton is observed every day, and detailed experimental records are made.
[0071] Furthermore, due to the presence of dark current in the camera and the uneven illumination intensity of different bands, some bands with weaker light intensity contain larger noise. Therefore, in order to remove the noise caused by the environment and dark current, the S2 preprocessing step is calibrated according to formula (1):
[0072]
[0073] Among them, I calibrated is the corrected image, I raw is the original hyperspectral image, I dark is the dark reflectance image with a reflectance of 0%, I white is a white reflectance image with a reflectance of approximately 100%. See the preprocessing process for Figure 3 ,Then, the calibrated images were used as the basis for subsequent ,processing and analysis, including data extraction and dataset construction.
[0074] Furthermore, in the S3 spectral data extraction step, the 458nm band of the hyperspectral sub-image taken by the camera was used as a reference, and the threshold was set to 0.02 to distinguish the foreground ROI and the background; due to factors such as the sensor, optical system, environmental factors, and calibration errors, the hyperspectral image has a small amount of noise at the beginning and end of the band, so the noise bands at both ends are removed, and the spectrum in the range of 405nm-1011nm is used for early detection of cotton wilt.
[0075] Furthermore, in the S3 spectral data extraction step, in order to reduce the influence of sample particle size, surface scattering effect and light path length difference on the near-infrared diffuse reflectance spectrum, the standard normal variable transformation SNV was used to pre-process the cotton spectral curve after removing the background before data analysis, which helps to correct these non-chemical variations in the spectral data to improve the accuracy of the analysis results, as shown in formula (2):
[0076]
[0077] In the formula, x is a sample with m features. is the sample feature mean, n is the number of samples, and i means that the data of the i-th sample is currently being calculated.
[0078] Furthermore, the division ratio in the S4 data set division step is: the training set and the test set are divided in a ratio of 4:1.
[0079] The cotton varieties include Xinlu Zao No. 1 and Xinlu Zao No. 76. The specific data collection and grading results are shown in Table 1:
[0080] Table 1 Data collection and division results
[0081]
[0082] As a generative model, the traditional GAN has obvious advantages. The generative model after adversarial training can generate realistic cotton Verticillium wilt data, which can be used for data enhancement for early detection of cotton Verticillium wilt to solve the problem of limited training samples. However, the traditional GAN also has two serious problems: first, the traditional GAN cannot control the mode of generated data. It is an unsupervised generation. It is difficult to generate multiple categories and cannot directly complete the classification task. Second, the traditional GAN also has the problem of gradient disappearance or explosion and training instability. The gradient changes are too large or too small, and the alternating training process of the two models is difficult to control, resulting in unstable network weight updates. There are also problems such as mode collapse and low generation resolution.
[0083] This paper uses an improved GAN structure, namely the Auxiliary Classifier GAN (ACGAN), named COTTON_GAN, for early detection of cotton Verticillium wilt to solve the problem of limited training samples in early detection of cotton Verticillium wilt. COTTON_GAN is a special GAN structure that realizes the control of generated data by improving the traditional GAN discriminant model, adding auxiliary classifiers to reconstruct label information, and introducing label reconstruction tasks. It not only stabilizes the GAN model and improves the quality of generated data, but also realizes the key task of data classification. This architecture combines the advantages of both conditional generative adversarial networks (Conditional GAN, CGAN) and semi-supervised generative adversarial networks (Semi-supervised GAN, SGAN). It uses label information for training and also reconstructs label information, thereby further improving the stability of the model and the quality of generated samples. The specific model structure of COTTON_GAN is as follows Figure 4 shown.
[0084] COTTON_GAN is mainly composed of three parts: the generative model G, the discriminative model D and the classification model C, whose inputs all include data or noise and their labels. The generative model G is responsible for capturing the conditional distribution of real cotton data, and generating realistic cotton data of a specific category with the help of additional label input to deceive the discriminative model D and the classification model C; the discriminative model D is responsible for judging whether the input data is real data from the training set or fake data generated by the generative model G, and guiding the generative model G to generate realistic data; the classification model C is responsible for classifying the category of the input data, and guiding the generative model G to generate data samples by category through back propagation, where the input data includes real data from the training set and fake data generated by the generative model G; finally, with the continuous alternating training of the discriminative model D, the classification model C and the generative model G, a "Nash equilibrium" is reached, and the optimal discriminative model D, the classification model C and the generative model G are output. However, the classification model C is the target model of the present invention. This is because the classification model C continuously inputs real cotton data and fake cotton data generated by the generation model G during the adversarial training process. In essence, it is performing online data enhancement and semi-supervised task learning. Therefore, the classification model C has good generalization performance and can also have strong performance under limited training samples.
[0085] In terms of specific implementation, the discriminant model D, the classification model C, and the generative model G are all implemented using the recurrent neural network LSTM as the basic model. The specific experimental hyperparameter settings are shown in Table 2. Specifically, it includes the discriminant model D, the classification model C, the generative model D, and the hyperparameters in the training process.
[0086] At the loss function level, due to the introduction of auxiliary classifiers, the loss of COTTON_GAN is also divided into the discriminant loss L s and classification loss L c For the discriminant model D and the classification model C, it is expected that both the classification is correct and the true and false can be distinguished correctly, so the loss is L s +L c ; For the generative model G, it is expected that the classification model C can correctly classify the data it generates, but it is expected that the discriminant model D cannot correctly distinguish true from false, so the loss of the generative model G is L s +L c .
[0087] Furthermore, the discriminant loss L in the S6 network model training step s and classification loss L c The calculation formula is as follows:
[0088] L s =E[logP(S=real|X real )]+E[logP(S=fake|X fake)] (3)
[0089] L c =E[logP(C=c|X real )]+E[logP(C=c|X fake )] (4)
[0090] Where E is the number of iterations, logP(S=real|X real ) is the real data X real The logarithmic probability of being judged as real, logP(S=fake|X fake ) is the generated data X fake The logarithmic probability of being judged as false, logP(C=c|X real ) is the real data X real The logarithmic probability of being classified as category c, logP(C=c|X fake ) is the generated data X fake The log probability of being classified as class c.
[0091] Table 2 Hyperparameter settings of COTTON_GAN
[0092]
[0093] Since training COTTON_GAN is difficult, the discriminant model D, the classification model C, and the generative model G are trained alternately to continuously improve the capabilities of each model through adversarial learning, which is often difficult to coordinate and may lead to instability. Therefore, a detailed training step and process are designed. The specific training procedure is shown in Table 3:
[0094] Table 3 COTTON_GAN training process
[0095]
[0096] and Figure 1 Corresponding to the method, the present invention also discloses a cotton Verticillium wilt early detection system based on a generative adversarial network, which executes any of the above-mentioned cotton Verticillium wilt early detection methods based on a generative adversarial network, comprising:
[0097] A hyperspectral image acquisition module is used to acquire a hyperspectral image of a cotton Verticillium wilt sample to obtain an original hyperspectral image;
[0098] The preprocessing module is used to perform black and white calibration on the original hyperspectral image to remove noise;
[0099] The spectral data extraction module is used to define the complete cotton plant as the region of interest (ROI) and create a binary mask, where 0 represents the background and 1 represents the foreground cotton plant. The binary mask is applied to the calibrated hyperspectral image to obtain a hyperspectral image with the background removed. Then, the average value of the pixels in each channel is calculated to preliminarily obtain the cotton spectral curve with the background removed. At the same time, the standard normal variable transformation (SNV) is used to preprocess the cotton spectral curve with the background removed to obtain the preprocessed hyperspectral image data.
[0100] A data set partitioning module is used to partition the preprocessed hyperspectral image data according to infection levels, and the training set and test set in each infection level are partitioned according to a preset ratio;
[0101] The network model building module is used to build the auxiliary classification generative adversarial network model COTTON_GAN, including: generation model G, discrimination model D and classification model C;
[0102] The network model training module is used to initialize all weight matrices and biases of the generation model G, the discriminant model D, and the classification model C, input the training set, and calculate the discriminant loss L s and classification loss L c , fix the discriminant model D and the classification model C, and maximize L c +L s Update the weight matrix and bias of the generative model G; by maximizing L c -L s Update the weight matrix and bias of the discriminant model D and the classification model C; obtain the trained auxiliary classification generative adversarial network model COTTON_GAN;
[0103] The detection module is used to input the hyperspectral image of the cotton to be detected into the trained auxiliary classification generative adversarial network model COTTON_GAN to obtain the detection result.
[0104] and Figure 1Corresponding to the method, the present invention also discloses system production steps. Based on the previously established high-precision cotton Verticillium wilt early detection model, from the perspective of software engineering, a set of cotton Verticillium wilt early detection system based on hyperspectral images is designed and developed. This system is mainly divided into three key modules: user management module, data extraction module and early detection module to ensure that the system can effectively meet the needs of users. The user management module mainly includes system functions such as user login, user registration, password retrieval and permission verification; the data extraction module mainly includes system functions such as data reading, image segmentation, spectrum extraction, image extraction and smoothing denoising; the early detection module mainly includes system functions of model integration, model management, historical results and result display. Through such a structured and modular design, each functional module is independent of each other, but can effectively collaborate to better meet the needs of users. The functional design of the entire system is as follows: Figure 5 As shown, the overall process of the system is as follows Figure 6 shown.
[0105] System presentation: Convert the designed software system into computer executable code.
[0106] User login module: see Figure 7 As shown, after the user registers an account, he can enter the main interface of cotton verticillium wilt early detection by entering the correct account password, and provide password retrieval service.
[0107] Data segmentation module: see Figure 8 As shown in the figure, after the user logs in successfully, he enters the main interface of the system, enters the path to read and import the cotton hyperspectral data, and selects the appropriate segmentation method and segmentation parameters to perform threshold segmentation on the hyperspectral image.
[0108] Data processing module: see Fig. 9 As shown in the figure, the user imports the hyperspectral data of the region of interest after the above segmentation, clicks Data Extraction, and the spectral data extraction is completed. Import the extracted data, select the appropriate processing method, click Data Processing, and pre-process the spectrum and remove noise.
[0109] Verticillium wilt early detection module: see Fig.10 As shown, import the preprocessed spectral curve and click the early detection button to detect the imported cotton data and return the results.
[0110] The COTTON_GAN model was compared with the deep learning model (LSTM) and the traditional machine learning (RF and SVM) methods, and the results are shown in Table 4 below. The COTTON_GAN model proposed in the present invention achieved the best results and a high accuracy of 94.52%, indicating that the method based on GAN spectral enhancement has achieved remarkable results in the early detection of cotton Verticillium wilt. Among them, the deep learning model LSTM performed better than the traditional machine learning RF and SVM methods, reaching an overall accuracy of 89.04%, showing the effectiveness of deep learning in this task. Finally, although the overall accuracy of traditional machine learning RF and SVM was 83.56% and 84.93% respectively, which was slightly inferior to the deep learning model and GAN spectral enhancement model, it still showed a certain detection ability. In order to fully explain the superiority of the COTTON_GAN model proposed in the present invention, the quality of the generated spectral samples was analyzed in the present invention, and the contribution of the spectral bands was also analyzed in detail. These analyses provide further explanation and support for the high accuracy of the model.
[0111] Table 4 Early detection results of cotton Verticillium wilt based on GAN spectral enhancement
[0112]
[0113]
[0114] For the similarity of generated spectrum samples, the present invention analyzes the iterative process of visualizing the real spectrum samples and the generated spectrum samples. Fig.11 As shown, from Fig.11 a to Fig.11 f are iterations 0, 100, 1000, 2000, 3000 and the real spectral sample. Fig.11 The changing trend between the generated spectral samples and the real spectral samples can be intuitively observed. During the iteration process, the generated spectral samples gradually approach the real samples, showing obvious similarity, which confirms the high-quality performance of the GAN model in spectral sample generation. The improvement of spectral similarity helps to ensure that the generated samples have good credibility and applicability in the early detection task of cotton Verticillium wilt, which further explains the reliability and credibility of the superior performance of the cotton spectral online enhancement method.
[0115] However, due to the small difference between the spectral curves of healthy and infected cotton, subjective judgment may not be accurate enough. Therefore, the present invention also calculates the RMSE and MEAN values between the real spectral samples and the generated spectral samples as an objective measure of sample similarity. The specific results are as follows Fig.12 As shown, Fig.12 a is RMSE, Fig.12 b is MEAN. Fig.12 It can be seen intuitively that with the iteration process, the RMSE value tends to converge, and the MEAN value of the generated spectral sample is getting closer and closer to the MEAN value of the real spectral sample. These data objectively prove the similarity of the generated samples, which also supports the conclusion of sample visualization, that is, the spectral samples generated by COTTON_GAN have high similarity.
[0116] Regarding the diversity of generated spectral samples, the present invention uses the T-SNE dimensionality reduction method to visualize the distribution of real and generated spectral samples in low-dimensional space during the iteration process for analysis. Fig.13 As shown, Fig.13 a and Fig.13 f are the spectral distributions of infected and healthy cotton at iterations 0, 1500 and 3000, respectively.
[0117] Fig.13 The changing trend of the distribution between the generated healthy and infected spectral samples and the real spectral samples can be intuitively observed. In the iterative process, the distribution of the generated spectral samples gradually approaches the distribution of the real samples, showing obvious similarities and certain expansibility. This shows that the COTTON_GAN model takes into account both the similarity and diversity of the generated spectral samples. Higher diversity allows for a wider range of creative possibilities, helps unlock additional useful information from the training set, and improves the generalization ability of the detection model. This also further explains the deep reason why the cotton spectral online enhancement method performs well.
[0118] Similarly, the present invention also quantifies the diversity of generated samples from the perspective of variance and standard deviation, as follows: Fig.14 As shown, Fig.14 a and Fig.14 b are the variance and standard deviation of generated samples and true samples respectively. Fig.14 It can be seen intuitively that with the iteration process, the variance and standard deviation of the generated samples gradually decrease and approach the real samples. However, it is worth noting that the variance and standard deviation of the generated samples are always close to and slightly larger than the variance and standard deviation of the real samples, which shows that the generated samples are slightly discrete while being close to the real sample distribution, maintaining a certain diversity. This conclusion is consistent with the above sample distribution.
[0119] In summary, the spectral samples generated by COTTON_GAN in the present invention have high similarity and certain diversity. Among them, the similarity of the generated cotton spectral samples ensures the identifiability and reliability of COTTON_GAN in the cotton Verticillium wilt detection task, and the diversity of the generated cotton spectral samples ensures the generalization ability and robustness of COTTON_GAN in cotton Verticillium wilt detection. These conclusions can explain the essential reasons for the superiority of COTTON_GAN spectral enhancement in the present invention in a deeper level.
[0120] In addition, the contribution of the spectral characteristic bands is analyzed. Characteristic band contribution analysis is a method used to study and explain the sensitivity of spectral curves under specific conditions. In order to explore the impact of cotton Verticillium wilt on the spectrum and determine the key bands sensitive to Verticillium wilt, this study used the Grad-CAM method to analyze the sensitive bands that different models focus on, so as to explain how the sensitive bands that the model focuses on correspond to the physiological characteristics of cotton Verticillium wilt and improve the interpretability of the model. Fig.15 As shown, from Fig.15 a to Fig.15 d are the band contributions of RF, SVM, LSTM and COTTON_GAN, which provide favorable observation results for spectral feature band analysis. Fig.15 It can be seen that the four models are all sensitive to the 600nm-750nm band, especially the RF, LSTM and COTTON_GAN models. Within this range, the contribution near the 675nm band is the largest. It can be found that the 675nm band is the peak and valley of the cotton spectrum curve and belongs to the key feature band. This is consistent with the result of manual feature selection of the spectrum and is identified as the key feature band. SVM contributes more near the 750nm and 1000nm bands. It can be found that the 750nm band is the spectral peak. Analysis shows that this may be the key feature of Verticillium wilt learned by the SVM model. It is worth noting that the deep learning models LSTM and COTTON_GAN show more concentrated contributions between 350nm-675nm, showing greater sensitivity to the bands in the visible light region. These observations further deepen the understanding of the differences in sensitivity of different models in specific bands and provide more clues for the interpretation of spectral features. The sensitivity of deep learning models in the visible light region may imply a more detailed and complex perception of the physiological state of plants. These findings provide useful guidance for spectral research and disease monitoring in the agricultural field.
[0121] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without creative work.
[0122] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for early detection of cotton Verticillium wilt based on generative adversarial networks, characterized in that: The following steps are involved: S1 hyperspectral image acquisition step: the sample on the day of the onset of the disease is the captured early cotton Verticillium wilt sample, and the hyperspectral image of the current cotton Verticillium wilt sample is captured to obtain the original hyperspectral image; S2 preprocessing step: black and white calibration of the original hyperspectral image to remove noise; S3 spectral data extraction steps: The complete cotton plant is defined as the region of interest (ROI), and a binary mask is created, where 0 represents the background and 1 represents the foreground cotton plant. The binary mask is applied to the calibrated hyperspectral image to obtain a hyperspectral image with the background removed. Then, the average value of the pixels in each channel is calculated to preliminarily obtain the cotton spectral curve with the background removed. At the same time, the standard normal variable transformation (SNV) is used to preprocess the cotton spectral curve with the background removed to obtain the preprocessed hyperspectral image data. S4 Dataset division step: The preprocessed hyperspectral image data is divided according to the infection level, and the training set and test set in each infection level are divided according to the preset ratio; S5 Network model construction steps: Auxiliary classification generation adversarial network model COTTON_GAN includes: generation model G, discrimination model D and classification model C; S6 network model training steps: Initialize all weight matrices and biases of the generation model G, the discriminant model D, and the classification model C, input the training set, and calculate the discriminant loss L s and classification loss L c , fix the discriminant model D and the classification model C, and maximize L c +L s Update the weight matrix and bias of the generative model G; by maximizing L c -L s Update the weight matrix and bias of the discriminant model D and the classification model C; obtain the trained auxiliary classification generative adversarial network model COTTON_GAN; S7 detection step: input the hyperspectral image of the cotton to be detected into the trained auxiliary classification generative adversarial network model COTTON_GAN to obtain the detection result.
2. The early detection method of cotton Verticillium wilt based on generative adversarial network according to claim 1, characterized in that: Before the S1 hyperspectral image acquisition step, a sample preparation step is also included, the specific contents are as follows: Two cotton varieties with different resistance to Verticillium wilt were selected, including Xinlu Zao 76 and Xinlu Zao 1, and soilless culture, i.e. hydroponic planting mode, was chosen for cotton planting.
3. The early detection method of cotton Verticillium wilt based on generative adversarial network according to claim 1, characterized in that: In the S2 preprocessing step, calibration is performed according to formula (1): Among them, I calibrated is the corrected image, I raw is the original hyperspectral image, I dark is the dark reflectance image with a reflectance of 0%, I white is a white reflectance image with a reflectance of 100%.
4. The early detection method of cotton Verticillium wilt based on generative adversarial network according to claim 1, characterized in that: In the S3 spectral data extraction step, the 458nm band of the hyperspectral sub-image captured by the camera was used as a reference, and the threshold was set to 0.02 to distinguish the foreground ROI and the background; the noise bands at both ends were removed, and the spectrum in the range of 405nm-1011nm was used for early detection of cotton wilt.
5. The early detection method of cotton Verticillium wilt based on generative adversarial network according to claim 4, characterized in that: In the S3 spectral data extraction step, the standard normal variable transformation SNV is used to preprocess the hyperspectral image data, as shown in formula (2): In the formula, x is a sample with m features. is the sample feature mean, n is the number of samples, and i means that the data of the i-th sample is currently being calculated.
6. The method for early detection of cotton Verticillium wilt based on generative adversarial networks according to claim 1, characterized in that: The division ratio in the S4 dataset division step is: the training set and the test set are divided in a ratio of 4:
1.
7. The early detection method of cotton Verticillium wilt based on generative adversarial network according to claim 1, characterized in that: S6 Discriminant loss L in the network model training step s and classification loss L c The calculation formula is as follows: L s =E[logP(S=real|X real )]+E[logP(S=fake|X fake )] (3) L c =E[logP(C=c|X real )]+E[logP(C=c|X fake )] (4) Where E is the number of iterations, logP(S=real|X real ) is the real data X real The logarithmic probability of being judged as real, logP(S=fake|X fake ) is the generated data X fake The logarithmic probability of being judged as false, logP(C=c|X real ) is the real data X real The logarithmic probability of being classified as category c, logP(C=c|X fake ) is the generated data X fake The log probability of being classified as class c.
8. An early detection system for cotton Verticillium wilt based on generative adversarial networks, characterized in that: Execute the cotton Verticillium wilt early detection method based on generative adversarial network according to any one of claims 1 to 7, comprising sequentially connecting A hyperspectral image acquisition module is used to acquire a hyperspectral image of a cotton Verticillium wilt sample to obtain an original hyperspectral image; The preprocessing module is used to perform black and white calibration on the original hyperspectral image to remove noise; The spectral data extraction module is used to define the complete cotton plant as the region of interest (ROI) and create a binary mask, where 0 represents the background and 1 represents the foreground cotton plant. The binary mask is applied to the calibrated hyperspectral image to obtain a hyperspectral image with the background removed. Then, the average value of the pixels in each channel is calculated to preliminarily obtain the cotton spectral curve with the background removed. At the same time, the standard normal variable transformation (SNV) is used to preprocess the cotton spectral curve with the background removed to obtain the preprocessed hyperspectral image data. A data set partitioning module is used to partition the preprocessed hyperspectral image data according to infection levels, and the training set and test set in each infection level are partitioned according to a preset ratio; The network model building module is used to build the auxiliary classification generative adversarial network model COTTON_GAN, including: generation model G, discrimination model D and classification model C; The network model training module is used to initialize all weight matrices and biases of the generation model G, the discriminant model D, and the classification model C, input the training set, and calculate the discriminant loss L s and classification loss L c , fix the discriminant model D and the classification model C, and maximize L c +L s Update the weight matrix and bias of the generative model G; by maximizing L c -L s Update the weight matrix and bias of the discriminant model D and the classification model C; obtain the trained auxiliary classification generative adversarial network model COTTON_GAN; The detection module is used to input the hyperspectral image of the cotton to be detected into the trained auxiliary classification generative adversarial network model COTTON_GAN to obtain the detection result.
