Tomato yellow leaf curl disease nondestructive testing method and device based on hyperspectral imaging technology
Hyperspectral data of tomato leaf samples were obtained through hyperspectral imaging technology, and feature extraction and classification were used by machine learning methods, solving the problems of low efficiency and high cost of detection of tomato yellow chrysanthemum leaf disease in the existing technology, and achieving efficient and accurate non-destructive testing.
Patent Information
- Application Number
- CN202411846801.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-04-11
AI Technical Summary
The prior art has problems of low efficiency and high cost in the early detection and rapid non-destructive testing of tomato chrysanthemum leaf disease, which is difficult to meet the needs of efficient testing under large-scale planting.
Hyperspectral imaging technology is used to obtain hyperspectral data of tomato leaf samples, and through machine learning methods, including support vector machines, partial least squares discriminant analysis and gradient hoisting machine models, the data is extracted and classified to achieve non-destructive detection.
It realizes efficient and accurate detection of tomato yellowing vermiscens disease, reduces detection cost and time, and is suitable for large-scale planting production practice.
Smart Images

Figure CN119810036A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of plant disease detection and prevention and control, and specifically relates to a nondestructive detection method and device for tomato yellow leaf curl disease based on hyperspectral imaging technology. Background Art
[0002] Tomato is one of the most commonly cultivated fruits and vegetables in the world. It is delicious and has high nutritional value, making it widely loved by people. Tomato yellow leaf curl is a very harmful disease. It has a long incubation period, its early symptoms are not obvious, and it is difficult to accurately distinguish by the human eye. In production, the disease is generally treated with physical isolation and biological control. Therefore, rapid and accurate detection of tomato yellow leaf curl, especially early detection, is of great significance in tomato planting and production practice. This is conducive to the removal of diseased plants, prevention and control of infectious sources, or physical isolation according to the degree of disease and spread of tomato plants, so as to prevent the rapid spread of the disease and cause greater losses.
[0003] At present, the detection of tomato yellow leaf curl mainly relies on biological detection methods, including polymerase chain reaction (PCR) and enzyme-linked immunosorbent assay (ELISA). Although these two methods have been verified by experiments and have the advantage of high accuracy, the detection process requires professionals, and the inspection is time-consuming and costly. It is difficult to achieve the purpose of efficient detection under the current situation of large-scale planting of tomato industry. In the urgent need for early detection and rapid non-destructive detection of tomato yellow leaf curl, it is necessary to find new technologies and methods to achieve the accuracy of early detection and breakthroughs in detection efficiency. Summary of the invention
[0004] The main purpose of the present invention is to overcome the shortcomings and deficiencies of the prior art and to provide a nondestructive detection method and device for tomato yellow leaf curl disease based on hyperspectral imaging technology. The method of the present invention uses hyperspectral imaging technology to nondestructively obtain hyperspectral data of tomato plant samples to be tested, and uses modeling methods including machine learning to extract features and classify the data, so as to efficiently and accurately obtain the classification results of tomato yellow leaf curl disease.
[0005] In order to achieve the above object, the present invention adopts the following technical solutions:
[0006] In a first aspect, the present invention provides a nondestructive detection method for tomato yellow leaf curl disease based on hyperspectral imaging technology, comprising the following steps:
[0007] Acquire hyperspectral imaging data of tomato leaf samples, wherein the tomato leaf samples include healthy samples and diseased samples infected with tomato yellow leaf curl disease;
[0008] Performing black-and-white correction on the hyperspectral imaging data, wherein the hyperspectral data after black-and-white correction is normalized data;
[0009] The black-and-white corrected hyperspectral image data is used to extract the region of interest and obtain the reflectance information corresponding to different bands;
[0010] Preprocess the hyperspectral data after extracting the area of interest to build the data set required for machine learning model training;
[0011] Perform feature extraction on the preprocessed hyperspectral data to obtain the key wavelength that has the largest contribution to the feature;
[0012] The support vector machine (SVM) model, the partial least squares discriminant analysis (PLS-DA) model and the gradient boosting machine (GBM) model were established, and the three models were trained using the processed hyperspectral data to obtain the trained classification models.
[0013] The tomato leaf samples to be tested are input into the trained classification model to detect tomato yellow leaf curl disease.
[0014] As a preferred technical solution, the acquisition of the hyperspectral imaging data is specifically as follows:
[0015] The spectral range of the hyperspectral imaging device is set to 400-1000nm;
[0016] After preheating the hyperspectral imaging device, black and white frame data are collected respectively, wherein the black frame is collected by turning off the light source, and the white frame is obtained by photographing a standard white board, wherein the standard white board is made of polytetrafluoroethylene and has a reflectivity of 99% in the 200nm to 2500nm band;
[0017] When shooting, place the hyperspectral imaging device above the plant to be tested, focus on the top true leaves of the plant, and shoot each sample plant by plant.
[0018] As a preferred technical solution, the hyperspectral imaging data is subjected to black and white correction, specifically:
[0019]
[0020] in:
[0021] I is the corrected spectral reflectance;
[0022] I0 is the original digital quantization value data before correction;
[0023] W is the DN value data of the whiteboard, obtained by collecting the standard whiteboard;
[0024] B is the DN value data of the dark current, which is obtained by shooting a black frame.
[0025] As a preferred technical solution, the region of interest extraction is specifically as follows:
[0026] For each hyperspectral image, multiple different regions of interest were manually selected on the latest 2 to 3 true leaves of the plant, and the reflectance data obtained from the multiple regions of interest were averaged, and the average value was used as the hyperspectral reflectance data of the plant.
[0027] As a preferred technical solution, the hyperspectral data after extracting the region of interest is preprocessed to construct a data set required for machine learning model training, specifically:
[0028] The preprocessing includes one or more of moving average smoothing, standard normal transformation, Savitzky-Golay convolution, and SG convolution first-order differential; when the data is preprocessed, the original data is retained as a control;
[0029] The moving average smoothing reduces the noise and detail variation of the data by calculating the average value of a series of consecutive data points;
[0030] The standard normal transformation is used to reduce the interference of uncertainty factors such as scattering effect and instrument response;
[0031] The Savitzky-Golay convolution uses a sliding window to perform a convolution operation to reduce noise and interference signals in the spectrum while retaining the smooth characteristics of the spectrum;
[0032] The SG convolution first-order differential is a method that combines Savitzky-Golay convolution smoothing and first-order differential. The SG method is used to smooth the data to reduce noise, and then the first-order differential is applied to the smoothed data to extract features.
[0033] As a preferred technical solution, the feature extraction is performed on the pre-processed hyperspectral data to obtain the key wavelength with the largest contribution to the feature, specifically:
[0034] First, the principal component analysis algorithm is used for dimensionality reduction and feature extraction, including the following steps:
[0035] Use the training data to fit the PCA object, calculate the principal components and the corresponding explained variance, and obtain the reduced-dimensional data;
[0036] According to the PCA results, the first n wavelengths with the largest weights are selected. These wavelengths correspond to the features that contribute most to the principal component and are called key wavelengths.
[0037] Secondly, the continuous projection algorithm is used for feature extraction, specifically:
[0038] Define a class called SPA to implement the continuous projection algorithm for feature selection;
[0039] Randomly select the first feature as the starting point, and iteratively select the new feature with the largest projection to the selected feature until the required number of features are selected;
[0040] Instantiate the SPA class, call the implementation method, use the training set data to perform feature selection, and obtain the selected feature index;
[0041] The feature extraction using competitive adaptive re-weighting algorithm comprises the following steps:
[0042] Define a class named CARS to implement the competitive adaptive reweighted sampling algorithm for feature selection, initialize the class instance, set the support vector machine SVC as the estimator, and select the number of features to be selected;
[0043] Implement the core logic of the CARS algorithm: Use the given estimator SVC to train the complete data set, and calculate the importance of the features based on the training results; the coefficients in the SVC determine the direction of the classification hyperplane. The larger the absolute value of the coefficient, the greater the influence of the corresponding feature on the classification boundary. Therefore, the absolute value of the SVC coefficient is used as the feature importance indicator;
[0044] Iterate multiple times, update the feature counter each time a feature is selected, and finally select the n features with the most occurrences as the feature extraction results;
[0045] Instantiate the CARS class, call the implementation method to perform feature selection using the training set data, and obtain the selected feature index.
[0046] The principal component analysis algorithm helps to find the main trend of changes in the data by selecting the direction with the largest variance as the principal component, thereby extracting the key wavelengths in the process of hyperspectral data processing;
[0047] The continuous projection algorithm is based on vector projection analysis and can quickly screen out the most representative characteristic wavelengths, thereby improving the efficiency of feature selection;
[0048] The competitive adaptive reweighting algorithm reduces model instability through Monte Carlo resampling.
[0049] As a preferred technical solution, a support vector machine model, a partial least squares discriminant analysis model and a gradient boosting machine model are used to classify diseased samples and healthy samples, that is, the hyperspectral data after the above processing and key wavelength extraction is used as the input of the model to train the classification prediction model to establish a trained classification model;
[0050] The processing of the support vector machine model is specifically as follows:
[0051] Initialize the SVM model and define the hyperparameter range, including the penalty coefficient C, kernel function kernel, kernel function parameter gamma, and whether to use probability estimation probability;
[0052] Traverse the defined hyperparameter grid, perform cross-validation scoring on each set of hyperparameter combinations, and record the best parameter combination and the corresponding highest score;
[0053] Use the SVM model with the best parameters to perform cross-validation prediction and obtain the prediction results;
[0054] The processing of the partial least squares discriminant analysis model is specifically as follows:
[0055] The PLS-DA model is trained using standardized data and encoded labels. PLS-DA captures the most important variability in the data by constructing components. When constructing each component, PLS-DA finds the most significant correlation between the explanatory variable and the response variable by maximizing the covariance between the component score and the response variable. Through the extracted components, the PLS-DA model reduces the high-dimensional data space to a lower-dimensional space and uses linear discriminant analysis to train the classification model.
[0056] The processing of the gradient boosting machine model is specifically as follows:
[0057] The gradient boosting machine iteratively integrates multiple weak learners. At each step, the newly integrated tree is trained on the residual of the previous step model to gradually reduce the overall prediction error. The learning rate parameter is used to control the contribution of each tree to the final prediction, and the early stopping mechanism is used to prevent overfitting, and finally a strong learner is formed.
[0058] The performance of the GBM model is optimized by minimizing the differentiable loss function and its generalization ability is evaluated under the cross-validation framework;
[0059] Stratified 3-fold cross validation was defined using StratifiedKFold to ensure that the proportion of classes in each fold was roughly the same.
[0060] In a second aspect, the present invention provides a nondestructive detection system for tomato yellow leaf curl disease based on hyperspectral imaging technology, which is applied to the nondestructive detection method for tomato yellow leaf curl disease based on hyperspectral imaging technology, including a data acquisition module, a correction module, a region of interest extraction module, a preprocessing module, a feature extraction module, a model training module and a detection module;
[0061] The data acquisition module is used to acquire hyperspectral imaging data of tomato leaf samples, wherein the tomato leaf samples include healthy samples and diseased samples infected with tomato yellow leaf curl disease;
[0062] The correction module is used to perform black-white correction on the hyperspectral imaging data, and the hyperspectral data after black-white correction is normalized data;
[0063] The region of interest extraction module is used to extract the region of interest from the hyperspectral image data after black-and-white correction to obtain reflectance information corresponding to different bands;
[0064] The preprocessing module is used to preprocess the hyperspectral data after the region of interest is extracted to construct a data set required for machine learning model training;
[0065] The feature extraction module is used to extract features from the pre-processed hyperspectral data to obtain the key wavelength with the largest contribution to the features;
[0066] The model training module is used to establish a support vector machine (SVM) model, a partial least squares discriminant analysis (PLS-DA) model, and a gradient boosting machine (GBM) model, and train the three models using the processed hyperspectral data to obtain a tomato yellow leaf curl disease detection model;
[0067] The detection module is used to input the tomato leaf sample to be detected into the tomato yellow leaf curl disease detection model to detect the tomato yellow leaf curl disease.
[0068] In a third aspect, the present invention provides an electronic device, the electronic device comprising:
[0069] at least one processor; and,
[0070] a memory communicatively connected to the at least one processor; wherein,
[0071] The memory stores computer program instructions that can be executed by the at least one processor, and the computer program instructions are executed by the at least one processor so that the at least one processor can execute the non-destructive detection method of tomato yellow leaf curl disease based on hyperspectral imaging technology.
[0072] In a fourth aspect, the present invention provides a computer-readable storage medium storing a program, which, when executed by a processor, implements the nondestructive detection method for tomato yellow leaf curl disease based on hyperspectral imaging technology.
[0073] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0074] The method of the present invention uses hyperspectral technology and hyperspectral imaging equipment to obtain hyperspectral images of tomato leaf samples (healthy and diseased) to be tested, and after black and white correction, ROI extraction, preprocessing and feature extraction of the hyperspectral images, the hyperspectral images are input into the trained classification prediction model to obtain the corresponding disease identification results. Among them, the acquisition of hyperspectral image data can be completed using existing hyperspectral imaging equipment, and the processes from noise removal, preprocessing to feature extraction are all processes of comprehensively using hyperspectral data processing technology.
[0075] The establishment of the classification prediction model of the present invention belongs to the application of machine learning technology. Therefore, the nondestructive detection method of tomato yellow leaf curl disease based on hyperspectral imaging technology proposed by the present invention is more efficient in obtaining the detection results of tomato yellow leaf curl disease, and the methods proposed by the present invention are all nondestructive processes and do not involve destructive operations such as crushing the sample. Therefore, the methods of the present invention are more conducive to application in production practice and other occasions where nondestructive and efficient detection is required. BRIEF DESCRIPTION OF THE DRAWINGS
[0076] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0077] Figure 1 This is a flow chart of a nondestructive detection method for tomato yellow leaf curl disease based on hyperspectral imaging technology according to an embodiment of the present invention;
[0078] Figure 2 A diagram showing the cultivation process of tomato plant samples used in experiments according to an embodiment of the present invention in an artificial climate chamber;
[0079] Figure 3 This is a graph showing the results of PCR testing of tomato samples used in experiments according to an embodiment of the present invention;
[0080] Figure 4 A schematic diagram of extracting ROI regions from hyperspectral images according to an embodiment of the present invention;
[0081] Figure 5a It is a hyperspectral curve diagram after black and white correction in the asymptomatic stage of the disease in the embodiment of the present invention;
[0082] Figure 5b is an average hyperspectral curve graph after black and white correction in the asymptomatic stage of the disease in the embodiment of the present invention;
[0083] Figure 6a It is a high-spectrum curve diagram after black-white correction in the disease manifestation stage of the embodiment of the present invention;
[0084] Figure 6b It is an average hyperspectral curve diagram after black and white correction in the disease manifestation stage of the embodiment of the present invention;
[0085] Figure 7a is a visualization result diagram of the key wavelength extracted by the CARS algorithm of an embodiment of the present invention;
[0086] Figure 7b It is a visualized probability density diagram of features extracted by the SPA algorithm in an embodiment of the present invention;
[0087] Figure 7c is a scatter plot showing the dimensionality reduction result of the PCA algorithm in an embodiment of the present invention, which is used to show the distribution of data on the first two principal components;
[0088] Figure 8 The block diagram of the tomato yellow leaf curl disease nondestructive detection system based on hyperspectral imaging technology according to an embodiment of the present invention.
[0089] Fig. 9 4 is a structural diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0090] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present application.
[0091] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments.
[0092] like Figure 1 As shown, this embodiment provides a nondestructive detection method for tomato yellow leaf curl disease based on hyperspectral imaging technology, including the following steps:
[0093] S1. Acquire hyperspectral imaging data of tomato leaf samples, wherein the tomato leaf samples include healthy samples and diseased samples infected with tomato yellow leaf curl disease.
[0094] In a specific embodiment, the hyperspectral imaging data of the tomato leaf sample is obtained by:
[0095] S11. Preparation of tomato yellow leaf curl disease samples:
[0096] In this embodiment, the tomato variety is Xinxing 101. The tomato seeds are sown in planting pots filled with culture soil and placed in an artificial climate chamber for cultivation. The climate chamber is controlled at a constant temperature of 26°C, with 16 hours of light per day, and is equipped with a mosquito patch. After the plant grows two cotyledons, each plant is transplanted to a separate planting pot. After the plant grows 4 to 5 true leaves, the virus is inoculated. The bacterial solution infected with the tomato yellow leaf curl virus is injected into the stem between the two cotyledons of the plant to complete the inoculation, and 1 / 4 of the plants are set aside as a blank control. Each plant is numbered and the inoculation information is recorded. The cultivation process of the tomato plant sample in the artificial climate chamber is as follows: Figure 2 shown.
[0097] S12, PCR detection:
[0098] PCR (polymerase chain reaction) is a molecular biology technique, and its principle is to amplify specific DNA fragments so that they can be detected. This embodiment uses PCR detection as an auxiliary verification method. 10 days and 25 days after the virus inoculation, PCR detection is performed on all experimental plants to determine the inoculation status and calculate the success rate. The test results show that on the 10th day, the virus was detected in a small number of virus-inoculated samples; on the 25th day, since the disease stage has entered the late stage, the virus was detected in most of the virus-inoculated samples. In this embodiment, the PCR test results on the 25th day are used as the basis for the infection of the samples. The results of the PCR test on the tomato samples used in the experiment are shown in the figure. Figure 3 shown.
[0099] S13, hyperspectral imaging data acquisition;
[0100] The hyperspectral imaging device used in this embodiment is a GaiaField hyperspectral camera with a spectral range of 400-1000nm, a spectral resolution of 3.5nm, and a spectral channel number of 256. This embodiment starts collecting hyperspectral imaging data 5 days after virus inoculation, and collects data every 48 hours in the first 10 days, every 72 hours within 10-20 days, and every 5 days after 20 days. Before each collection, preheat the hyperspectral camera for 30 minutes, preheat the halogen light source for more than 10 minutes to ensure the stability of the hyperspectral imaging system, and then collect black and white frame data respectively, where the black frame is obtained by turning off the light source, and the white frame is obtained by shooting a standard white board (polytetrafluoroethylene material, with a reflectivity of 99% in the 200nm-2500nm band). When shooting, place the hyperspectral camera 30CM above the plant to be tested, focus on the top true leaf part of the plant, and shoot the samples one by one.
[0101] S2, perform black and white correction and data normalization on the collected hyperspectral data;
[0102] Furthermore, the hyperspectral imaging data is subjected to black and white correction, specifically:
[0103]
[0104] in:
[0105] I is the corrected spectral reflectance;
[0106] I0 is the original digital quantization value data before correction;
[0107] W is the DN value data of the whiteboard, obtained by collecting the standard whiteboard;
[0108] B is the DN value data of the dark current, which is obtained by shooting a black frame.
[0109] Figure 5a It is a hyperspectral curve graph after black and white correction at the asymptomatic stage of the disease; Figure 5b It is the average hyperspectral curve after black and white correction during the asymptomatic stage of the disease.
[0110] Figure 5a Each curve in the figure represents a sample in the asymptomatic stage of the disease, where each "Inocolated" curve represents the high-spectral reflectance-wavelength change trend of a virus-inoculated sample; each "Control" curve represents the high-spectral reflectance-wavelength change trend of a healthy control sample.
[0111] Figure 5b The two curves in the figure represent the average reflectance trends in the asymptomatic stage of the disease. The "Inocolated" curve represents the average change trend of the high-spectral reflectance-wavelength of all virus-inoculated group samples; the "Control" curve represents the average change trend of the high-spectral reflectance-wavelength of all healthy control group samples.
[0112] Figure 6a It is a hyperspectral curve after black and white correction at the stage of disease manifestation; Figure 6b It is the average hyperspectral curve after black and white correction at the symptom stage of the disease;
[0113] Figure 6a Each curve in the figure represents a sample at the disease evidence stage, where each "Inocolated and infected" curve represents the high-spectral reflectance-wavelength change trend of a sample that was inoculated and tested to be actually infected with the virus; each "Inocolated but uninfected" curve represents the high-spectral reflectance-wavelength change trend of a sample that was inoculated but tested to be not actually infected with the virus; each "Control" curve represents the high-spectral reflectance-wavelength change trend of a healthy control sample.
[0114] Figure 6b The three curves in the figure represent the average reflectance trend of the disease evidence stage, among which the "Inocolated and infected" curve represents the average change trend of the high-spectral reflectance-wavelength of all samples inoculated and tested for actual infection with the virus group; the "Inocolated but uninfected" curve represents the average change trend of the high-spectral reflectance-wavelength of all samples inoculated but tested for actual infection with the virus group. The "Control" curve represents the average change trend of the high-spectral reflectance-wavelength of all healthy control group samples.
[0115] S3, extraction of regions of interest;
[0116] Furthermore, in this embodiment, the extraction of the region of interest is completed by ENVI5.3 software. For each hyperspectral image, three different ROIs are manually selected on the latest 2 to 3 true leaves of the plant, and the reflectance data obtained from the three ROIs are averaged as the hyperspectral reflectance data of the plant. Figure 4 shown.
[0117] S4. Data preprocessing: The purpose of preprocessing is to remove noise from the data, amplify the effective information in the data, improve data quality, and improve the accuracy and reliability of subsequent analysis and modeling.
[0118] It can be understood that, since the signal-to-noise ratio of the hyperspectral data in the first and last bands is low, they are removed in this embodiment, and the data in the range of 450-930 nm is retained.
[0119] Furthermore, the preprocessing methods used in this embodiment include moving average smoothing (MAS), standard normal transformation (SNV), Savitzky-Golay convolution (SG), first-order differential (FD), and SG convolution first-order differential (SG-FD).
[0120] Furthermore, MAS reduces the noise and detail changes of the data by calculating the average of a series of consecutive data points. For a given data sequence x1, x2, ..., xn, the formula for moving average smoothing can be expressed as:
[0121]
[0122] In the formula, y i is the ith smoothed data point, x j is the original data point. m is the moving average window size, which determines the degree of smoothing. In a more specific embodiment of the present invention, the window size m is set to 5.
[0123] Furthermore, SNV can reduce the interference of uncertainties such as scattering effects and instrument response. The implementation of SNV includes the following steps:
[0124] 1) Calculate the mean value of each sample;
[0125] 2) Subtract the mean value of each sample from the original spectrum;
[0126] 3) Calculate the standard deviation of each sample;
[0127] 4) Divide the spectral data of each sample by the standard deviation at its corresponding wavelength position.
[0128] The formula for SNV can be expressed as:
[0129]
[0130] Where X represents the original spectral data, μ is the mean value, and σ is the standard deviation.
[0131] Furthermore, Savitzky-Golay convolution is a method of performing convolution operations using a sliding window, which can effectively reduce noise and interference signals in the spectrum while retaining the smooth characteristics of the spectrum. For a given data point x i , the formula of SG smoothing can be expressed as:
[0132]
[0133] In the formula, K ij is the convolution kernel coefficient determined by the least squares method, and m is half the window width.
[0134] The first-order differential processing of hyperspectral data can enhance the peak and valley information in the spectrum, making the features in the spectrum more obvious, thereby increasing the amount of spectrum information; the calculation formula of the first-order differential is:
[0135] FD i =x i+1 -x i
[0136] In the formula, x i is the i-th data point, FD i is the data point after the ith differentiation.
[0137] Furthermore, SG convolution first-order differential is a method that combines Savitzky-Golay convolution smoothing and first-order differential. First, the SG method is used to smooth the data to reduce noise, and then the first-order differential is applied to the smoothed data to extract features. The formula of SG-FD can be expressed as:
[0138]
[0139] In the formula, K ij is the convolution kernel coefficient of SG smoothing, x i+j+1 -x i+j Represents the first-order differential of the original data.
[0140] S5, extracting key wavelengths using a feature extraction algorithm;
[0141] It can be understood that the feature extraction algorithm is a key step in the hyperspectral image processing process in this embodiment, which is used to identify and extract the wavelength most relevant to the target feature. Since there is a lot of redundant information in the hyperspectral data, this redundant information will affect the accurate prediction and classification of diseases. Therefore, the feature extraction algorithm is used in this embodiment to extract the key features in the data that contribute most to the classification of diseases.
[0142] The feature extraction algorithms used in this embodiment include principal component analysis (PCA), successive projections algorithm (SPA) and competitive adaptive reweighting algorithm (CARS). These algorithms analyze the spectral features of hyperspectral data and identify key wavelengths that contribute significantly to sample identification and classification.
[0143] Furthermore, PCA is an efficient dimensionality reduction method that can quickly reduce redundant information in data and improve processing efficiency.
[0144] PCA helps to discover the main variation trends in the data by selecting the direction with the largest variance as the principal component, thereby extracting key wavelengths during hyperspectral data processing. Figure 7c It is a scatter plot showing the dimensionality reduction results of the PCA algorithm, which is used to show the distribution of data on the first two principal components.
[0145] Furthermore, the SPA algorithm is based on vector projection analysis and can quickly screen out the most representative characteristic wavelengths, thus improving the efficiency of feature selection. Figure 7b It is a visual probability density map of features extracted by the SPA algorithm.
[0146] Furthermore, the core of the CARS algorithm is to adaptively adjust the selection probability of each band, without manually setting the threshold, reducing the interference of subjective factors. In the CARS algorithm, Monte Carlo resampling is used to reduce model instability and improve algorithm robustness. Figure 7a This is a visualization of the key wavelengths extracted by the CARS algorithm.
[0147] The top ten key wavelengths with the highest contribution extracted by the principal component analysis (PCA), the successive projection algorithm (SPA) and the competitive adaptive reweighting algorithm (CARS) are shown in Table 1.
[0148] Table 1. The top ten key wavelengths (unit: nm) extracted by each feature extraction algorithm based on their contribution to the original data
[0149]
[0150] Furthermore, the feature extraction is performed on the pre-processed hyperspectral data to obtain the key wavelength with the largest contribution to the feature, specifically:
[0151] S51, using the principal component analysis algorithm to perform dimensionality reduction and feature extraction, the steps are as follows:
[0152] a. Data loading and merging
[0153] Load the data of the control group and the virus-infected group separately and merge them into one dataset, merging the wavelength data and labels at the same time.
[0154] b. Data standardization
[0155] The data was normalized to ensure that each feature (band) had a mean of 0 and a standard deviation of 1 to ensure that each feature contributed equally to the results.
[0156] c. Initialize the PCA object
[0157] Initialize a PCA object. The PCA object contains multiple attributes, such as components_ (principal components), explained_variance_ratio_ (explained variance ratio), etc., which can be used to further analyze the results of PCA.
[0158] d. Perform PCA dimensionality reduction
[0159] Use the training data to fit the PCA object, calculate the principal components (i.e. eigenvectors) and the corresponding explained variance, and obtain the reduced-dimensional data.
[0160] e. Print explained variance
[0161] Prints the proportion of variance explained by each principal component, which helps understand the contribution of each principal component to the variance of the dataset.
[0162] f. Select the key wavelength
[0163] According to the PCA results, the first n wavelengths with the largest weights are selected. These wavelengths correspond to the features that contribute most to the principal component and are called key wavelengths.
[0164] g. Print key wavelengths and their contributions
[0165] Print out the key wavelengths, which can be considered the most representative features in the data for subsequent modeling.
[0166] h. Visualize PCA results
[0167] Draw a scatter plot to visualize the PCA results, showing the distribution of the first two principal components and coloring the points according to the class label.
[0168] S52, using the continuous projection algorithm to extract features, the steps are as follows:
[0169] a. Data loading and merging
[0170] Load the data of the control group and the virus-infected group separately and merge them into one dataset, merging the label and wavelength information at the same time.
[0171] b. Data standardization
[0172] The merged data is standardized to eliminate the dimensional effects of different features so that the mean of each feature is 0 and the standard deviation is 1.
[0173] c. Dataset Division
[0174] The dataset is divided into a training set and a test set, where the test set accounts for 30%, and a random seed is set to ensure the reproducibility of the results.
[0175] d. SPA feature selection algorithm implementation
[0176] Define a class called SPA to implement the continuous projection algorithm for feature selection. Initialize the class instance and set the number of features to be selected and the random seed.
[0177] Implement the core logic of the SPA algorithm: randomly select the first feature as the starting point. Iteratively select the new feature with the largest projection with the selected feature until the required number of features are selected.
[0178] e. Feature selection
[0179] Instantiate the SPA class, call the implementation method, use the training set data to perform feature selection, and obtain the selected feature index.
[0180] f. Results visualization and presentation
[0181] Get the key wavelengths selected by the SPA algorithm, calculate the mean reflectance of these wavelengths, then create a table containing the wavelengths and the corresponding reflectance and print it.
[0182] In addition, the selected key wavelengths and their mean reflectance are visualized through bar graphs.
[0183] S53, using a competitive adaptive reweighting algorithm to extract features, the steps are as follows:
[0184] a. Data loading and merging
[0185] Load the data of the control group and the virus-infected group separately and merge them into one dataset, merging the label and wavelength information at the same time.
[0186] b. Data standardization
[0187] The merged data is standardized to eliminate the dimensional effects of different features so that the mean of each feature is 0 and the standard deviation is 1.
[0188] c. Dataset Division
[0189] The dataset is divided into a training set and a test set, with the test set accounting for 30%. A random seed is set to ensure the reproducibility of the results.
[0190] d. Implement the CARS algorithm
[0191] Define a class called CARS to implement the competitive adaptive reweighted sampling algorithm for feature selection. Initialize the class instance, set the support vector machine SVC as the estimator, and select the number of features to be selected.
[0192] Implement the core logic of the CARS algorithm: Use the given estimator (Support Vector Classification, SVC) to train the complete data set, and calculate the importance of the features based on the training results. The coefficients in the SVC determine the direction of the classification hyperplane. The larger the absolute value of the coefficient, the greater the influence of the corresponding feature on the classification boundary. Therefore, the absolute value of the SVC coefficient is used as the feature importance indicator.
[0193] Iterate multiple times, update the feature counter each time a feature is selected, and finally select the n features with the largest number of occurrences as the feature extraction results.
[0194] e. Feature selection
[0195] Instantiate the CARS class, call the implementation method to perform feature selection using the training set data, and obtain the selected feature index.
[0196] f. Results visualization and presentation
[0197] Get the key wavelengths selected by the CARS algorithm, calculate the mean reflectance of these wavelengths, then create a table containing the wavelengths and the corresponding reflectance and print it.
[0198] S6. Build a machine learning model for classification;
[0199] This embodiment uses support vector machine (SVM), partial least squares discriminant analysis (PLS-DA) and gradient boosting machine (GBM) models to classify diseased and healthy samples, that is, the hyperspectral data after the above processing and key wavelength extraction is used as the input of the model to train the classification prediction model to establish a trained classification model.
[0200] SVM distinguishes different categories by finding an optimal hyperplane in the feature space. The selection criterion of this hyperplane is to maximize the interval between two categories.
[0201] Furthermore, SVM is robust to noise and outliers in the data, so it has advantages in noise processing in hyperspectral data.
[0202] PLS-DA is a supervised discriminant analysis method. Its basic principle is to introduce discriminant analysis on the basis of PLS regression, integrate the category information of the sample into the latent variable extraction process, and extract a series of latent variables that take into account the variance of both independent variables and dependent variables by maximizing the covariance between X and Y. Discriminant analysis and classification prediction are then performed based on these latent variables.
[0203] Furthermore, PLS-DA can handle the multicollinearity problem in hyperspectral data.
[0204] GBM is an ensemble learning algorithm that improves prediction performance by building multiple weak learners and gradually optimizing the model.
[0205] Furthermore, the weak learner in the GBM model in this embodiment is a decision tree.
[0206] Furthermore, the trained classification model is established as follows:
[0207] S61, support vector machine model, the specific processing is as follows:
[0208] a. Data processing
[0209] Loading data:
[0210] Define two folder paths to store the hyperspectral data of the control group and the virus-infected group respectively. Read the hyperspectral data file from the specified folder and load the reflectance data into memory. The function returns the data array and the corresponding label.
[0211] Merge data:
[0212] Load the data of the control group and the virus-infected group separately and merge them into one dataset, merging the labels at the same time.
[0213] Data Standardization:
[0214] The merged data is standardized to eliminate the dimensional effects of different features so that the mean of each feature is 0 and the standard deviation is 1.
[0215] b. Model training
[0216] Cross-validation settings: Create a stratified 3-fold cross-validation (StratifiedKFold) to ensure that the proportion of classes in each fold is roughly the same.
[0217] Initialize the SVM model: Initialize the SVM model and define the hyperparameter range, including the penalty coefficient C, kernel function kernel, kernel function parameter gamma, and whether to use probability estimation probability.
[0218] Hyperparameter grid search: traverse the defined hyperparameter grid, perform cross-validation scoring on each set of hyperparameter combinations, and record the best parameter combination and the corresponding highest score.
[0219] Output best parameters and scores: Print out the best hyperparameter combination and the corresponding best cross-validation score.
[0220] Cross-validation prediction: Use the SVM model with the best parameters to perform cross-validation prediction and obtain the prediction results.
[0221] c. Result evaluation
[0222] Plot confusion matrix to visualize model performance and print classification report including precision, recall, F1 score, etc. as specific evaluation criteria of model performance.
[0223] S62, partial least squares discriminant analysis model, the specific processing is as follows:
[0224] a. Data processing
[0225] Loading data:
[0226] Define two folder paths to store the hyperspectral data of the control group and the virus-infected group respectively. Read the hyperspectral data file from the specified folder and load the reflectance data into memory. The function returns the data array and the corresponding label.
[0227] Merge data:
[0228] Load the data of the control group and the virus-infected group separately and merge them into one dataset, merging the labels at the same time.
[0229] Data Standardization:
[0230] The merged data is standardized to eliminate the dimensional effects of different features so that the mean of each feature is 0 and the standard deviation is 1.
[0231] Label encoding:
[0232] Use LabelEncoder to encode the label and convert the category label into integer form.
[0233] b. Model training
[0234] Building the PLS-DA model:
[0235] Initialize the PLSRegression model and set the number of PLS components.
[0236] Model training:
[0237] The PLS-DA model is trained using the standardized data X and the encoded labels y. PLS-DA captures the most important variability in the data by constructing components. When constructing each component, PLS-DA finds the most significant correlation between the explanatory variables and the response variable by maximizing the covariance between the component scores (linear combinations of X) and the response variable (Y). Through the extracted components, the PLS-DA model reduces the high-dimensional data space to a lower-dimensional space and uses linear discriminant analysis (LDA) to train the classification model.
[0238] Model predictions:
[0239] The trained PLS-DA model is used to predict the data. Since the PLS regression output is a continuous value, 0.5 is set as the threshold for classification.
[0240] c. Result evaluation
[0241] Plot confusion matrix to visualize model predictions. Print classification report including precision, recall, F1 score, etc. as specific evaluation criteria of model performance.
[0242] Cross-validation scoring:
[0243] Evaluate the performance of the model using 5-fold cross validation and print the cross validation average score.
[0244] S63, gradient boosting model, the specific processing is as follows:
[0245] a. Data processing
[0246] Loading data:
[0247] Define two folder paths to store the hyperspectral data of the control group and the virus-infected group respectively. Read the hyperspectral data file from the specified folder and load the reflectance data into memory. The function returns the data array and the corresponding label.
[0248] Merge datasets:
[0249] Load the data of the control group and the virus-infected group separately and merge them into one dataset, merging the labels at the same time.
[0250] Data standardization:
[0251] The merged data is standardized to eliminate the dimensional effects of different features so that the mean of each feature is 0 and the standard deviation is 1.
[0252] b. Model training
[0253] Define the GBM classification model:
[0254] Initialize the GradientBoostingClassifier model and set the number of base learners, learning rate, maximum depth of decision tree, and random seed.
[0255] Model training: Gradient boosting machine (GBM) iteratively integrates multiple weak learners (decision trees in this invention), and each newly integrated tree is trained on the residual of the previous model to gradually reduce the overall prediction error. The learning rate parameter is used to control the contribution of each tree to the final prediction, and the early stopping mechanism is used to prevent overfitting, and finally a strong learner is formed.
[0256] In this paper, the performance of the GBM model is optimized by minimizing the differentiable loss function, and its generalization ability is evaluated under the cross-validation framework.
[0257] Define stratified cross validation:
[0258] Stratified 3-fold cross validation was defined using StratifiedKFold to ensure that the proportion of classes in each fold was roughly the same.
[0259] Cross-validation predictions:
[0260] Use the cross_val_predict function to perform cross-validation prediction and get the prediction results.
[0261] c. Result evaluation:
[0262] Plot confusion matrix to visualize model predictions. Print classification report including precision, recall, F1 score, etc. as specific evaluation criteria of model performance.
[0263] S7, input the tomato leaf samples to be tested into the trained classification model to detect tomato yellow leaf curl disease, and evaluate the model effect according to the test results.
[0264] This example uses overall accuracy, F1 score, and macro-average recall as evaluation indicators for the model's detection effect on tomato yellow leaf curl. Among them, overall accuracy provides a simple and intuitive overview of the overall performance of the model; the F1 score comprehensively considers the precision and recall of the model; and the macro-average recall reflects the recall performance of the model for an unbalanced data set. The specific formulas of these evaluation indicators are shown in Table 2.
[0265] Table 2 Evaluation indexes for tomato yellow leaf curl disease detection results in the present invention
[0266]
[0267] Among them, TP is true positive, which means that the healthy sample is correctly diagnosed as a healthy sample; FP is false positive, which means that the healthy sample is wrongly diagnosed as an infected sample; TN is true negative, which means that the infected sample is correctly diagnosed as an infected sample; FN is false negative, which means that the infected sample is wrongly diagnosed as a healthy sample. i is the ratio of the number of samples in the i-th category to the total number of samples.
[0268] Based on the classification prediction model trained in this embodiment, when detecting tomato yellow leaf curl disease, the spectral data of the tomato plant to be tested is collected, and the hyperspectral data is corrected for black and white, the region of interest is extracted and the average spectrum is calculated, and then preprocessing is performed, and the key wavelength is extracted using a feature extraction algorithm. The results after the above processing are input into the trained classification prediction model, and the classification prediction results are output through the classification prediction model. The detection results of the classification model are evaluated using the given evaluation indicators. The detection accuracy is shown in Table 3.
[0269] Table 3. Detection accuracy of the present invention in the asymptomatic stage of tomato yellow leaf curl disease
[0270]
[0271] It should be noted that, for the sake of convenience, the aforementioned method embodiments are all expressed as a series of action combinations, but those skilled in the art should know that the present invention is not limited to the described order of actions, because according to the present invention, certain steps can be performed in other orders or simultaneously.
[0272] Based on the same idea as the nondestructive detection method for tomato yellow leaf curl disease based on hyperspectral imaging technology in the above-mentioned embodiment, the present invention also provides a nondestructive detection system for tomato yellow leaf curl disease based on hyperspectral imaging technology, which can be used to execute the above-mentioned nondestructive detection method for tomato yellow leaf curl disease based on hyperspectral imaging technology. For ease of explanation, the structural schematic diagram of the embodiment of the nondestructive detection system for tomato yellow leaf curl disease based on hyperspectral imaging technology only shows the parts related to the embodiment of the present invention. Those skilled in the art can understand that the illustrated structure does not constitute a limitation on the device, and may include more or fewer components than shown in the diagram, or combine certain components, or arrange the components differently.
[0273] See also Figure 8 In another embodiment of the present application, a nondestructive detection system 100 for tomato yellow leaf curl disease based on hyperspectral imaging technology is provided, the system comprising a data acquisition module 101, a correction module 102, a region of interest extraction module 103, a preprocessing module 104, a feature extraction module 105, a model training module 106 and a detection module 107;
[0274] The data acquisition module 101 is used to acquire hyperspectral imaging data of tomato leaf samples, wherein the tomato leaf samples include healthy samples and diseased samples infected with tomato yellow leaf curl disease;
[0275] The correction module 102 is used to perform black-white correction on the hyperspectral imaging data, and the hyperspectral data after black-white correction is normalized data;
[0276] The region of interest extraction module 103 is used to extract the region of interest from the hyperspectral image data after black-and-white correction to obtain reflectance information corresponding to different bands;
[0277] The preprocessing module 104 is used to preprocess the hyperspectral data after the region of interest is extracted to construct a data set required for machine learning model training;
[0278] The feature extraction module 105 is used to extract features from the pre-processed hyperspectral data to obtain the key wavelength with the largest contribution to the features;
[0279] The model training module 106 is used to establish a support vector machine SVM model, a partial least squares discriminant analysis PLS-DA model and a gradient boosting machine GBM model, and use the processed hyperspectral data to train the three models to obtain a tomato yellow leaf curl disease detection model;
[0280] The detection module 107 is used to input the tomato leaf sample to be detected into the tomato yellow leaf curl disease detection model to detect the tomato yellow leaf curl disease.
[0281] It should be noted that the tomato yellow leaf curl disease nondestructive detection system based on hyperspectral imaging technology of the present invention corresponds one to one to the tomato yellow leaf curl disease nondestructive detection method based on hyperspectral imaging technology of the present invention. The technical features and beneficial effects described in the embodiment of the tomato yellow leaf curl disease nondestructive detection method based on hyperspectral imaging technology are applicable to the embodiment of the tomato yellow leaf curl disease nondestructive detection based on hyperspectral imaging technology. For specific contents, please refer to the description in the embodiment of the method of the present invention, which will not be repeated here. Hereby declared.
[0282] In addition, in the implementation of the tomato yellow leaf curl disease nondestructive detection system based on hyperspectral imaging technology in the above-mentioned embodiment, the logical division of each program module is only an example. In actual applications, the above-mentioned functions can be assigned to different program modules as needed, for example, for the configuration requirements of the corresponding hardware or the convenience of software implementation. That is, the internal structure of the tomato yellow leaf curl disease nondestructive detection system based on hyperspectral imaging technology is divided into different program modules to complete all or part of the functions described above.
[0283] See also Fig. 9 In one embodiment, an electronic device for implementing a nondestructive detection method for tomato yellow leaf curl disease based on hyperspectral imaging technology is provided. The electronic device 200 may include a first processor 201, a first memory 202 and a bus, and may also include a computer program stored in the first memory 202 and executable on the first processor 201, such as a nondestructive detection program 203 for tomato yellow leaf curl disease based on hyperspectral imaging technology.
[0284] Among them, the first memory 202 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, disk, optical disk, etc. In some embodiments, the first memory 202 can be an internal storage unit of the electronic device 200, such as a mobile hard disk of the electronic device 200. In other embodiments, the first memory 202 can also be an external storage device of the electronic device 200, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 200. Further, the first memory 202 can also include both an internal storage unit of the electronic device 200 and an external storage device. The first memory 202 can not only be used to store application software and various types of data installed in the electronic device 200, such as the code of the tomato yellow leaf curl disease non-destructive detection program 203 based on hyperspectral imaging technology, but also can be used to temporarily store data that has been output or is to be output.
[0285] In some embodiments, the first processor 201 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips, etc. The first processor 201 is the control core (Control Unit) of the electronic device, and uses various interfaces and lines to connect various components of the entire electronic device, and executes various functions and processes data of the electronic device 200 by running or executing programs or modules stored in the first memory 202, and calling data stored in the first memory 202.
[0286] Fig. 9 Only an electronic device with components is shown, and those skilled in the art will understand that Fig. 9 The structure shown does not constitute a limitation on the electronic device 200 , and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.
[0287] The nondestructive detection program 203 of tomato yellow leaf curl disease based on hyperspectral imaging technology stored in the first memory 202 of the electronic device 200 is a combination of multiple instructions. When running in the first processor 201, it can achieve:
[0288] Acquire hyperspectral imaging data of tomato leaf samples, wherein the tomato leaf samples include healthy samples and diseased samples infected with tomato yellow leaf curl disease;
[0289] Performing black-and-white correction on the hyperspectral imaging data, wherein the hyperspectral data after black-and-white correction is normalized data;
[0290] The black-and-white corrected hyperspectral image data is used to extract the region of interest and obtain the reflectance information corresponding to different bands;
[0291] Preprocess the hyperspectral data after extracting the area of interest to build the data set required for machine learning model training;
[0292] Perform feature extraction on the preprocessed hyperspectral data to obtain the key wavelength that has the largest contribution to the feature;
[0293] The support vector machine (SVM) model, the partial least squares discriminant analysis (PLS-DA) model and the gradient boosting machine (GBM) model were established, and the three models were trained using the processed hyperspectral data to obtain the trained classification models.
[0294] The tomato leaf samples to be tested are input into the trained classification model to detect tomato yellow leaf curl disease.
[0295] Furthermore, if the module / unit integrated in the electronic device 200 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a non-volatile computer-readable storage medium. The computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM).
[0296] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can 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. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0297] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0298] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be equivalent replacement methods and are included in the protection scope of the present invention.
Claims
1. A nondestructive detection method for tomato yellow leaf curl disease based on hyperspectral imaging technology, characterized in that: The steps include: Acquire hyperspectral imaging data of tomato leaf samples, wherein the tomato leaf samples include healthy samples and diseased samples infected with tomato yellow leaf curl disease; Performing black-and-white correction on the hyperspectral imaging data, wherein the hyperspectral data after black-and-white correction is normalized data; The black-and-white corrected hyperspectral image data is used to extract the region of interest and obtain the reflectance information corresponding to different bands; Preprocess the hyperspectral data after extracting the area of interest to build the data set required for machine learning model training; Perform feature extraction on the preprocessed hyperspectral data to obtain the key wavelength that has the largest contribution to the feature; The support vector machine (SVM) model, the partial least squares discriminant analysis (PLS-DA) model and the gradient boosting machine (GBM) model were established, and the three models were trained using the processed hyperspectral data to obtain the trained classification models. The tomato leaf samples to be tested are input into the trained classification model to detect tomato yellow leaf curl disease.
2. According to the nondestructive detection method of tomato yellow leaf curl disease based on hyperspectral imaging technology in claim 1, it is characterized in that: The acquisition of the hyperspectral imaging data is specifically as follows: The spectral range of the hyperspectral imaging device is set to 400-1000nm; After preheating the hyperspectral imaging device, black and white frame data are collected respectively, wherein the black frame is collected by turning off the light source, and the white frame is obtained by photographing a standard white board, wherein the standard white board is made of polytetrafluoroethylene and has a reflectivity of 99% in the 200nm to 2500nm band; When shooting, place the hyperspectral imaging device above the plant to be tested, focus on the top true leaves of the plant, and shoot each sample plant by plant.
3. The nondestructive detection method for tomato yellow leaf curl disease based on hyperspectral imaging technology according to claim 1 is characterized in that: The hyperspectral imaging data is subjected to black and white correction, specifically: in: I is the corrected spectral reflectance; I0 is the original digital quantization value data before correction; W is the DN value data of the whiteboard, obtained by collecting the standard whiteboard; B is the DN value data of the dark current, which is obtained by shooting a black frame.
4. The nondestructive detection method for tomato yellow leaf curl disease based on hyperspectral imaging technology according to claim 1, characterized in that: The specific extraction of the region of interest is: For each hyperspectral image, multiple different regions of interest were manually selected on the latest 2 to 3 true leaves of the plant, and the reflectance data obtained from the multiple regions of interest were averaged, and the average value was used as the hyperspectral reflectance data of the plant.
5. The nondestructive detection method for tomato yellow leaf curl disease based on hyperspectral imaging technology according to claim 1, characterized in that: The hyperspectral data after the region of interest is extracted is preprocessed to construct a data set required for machine learning model training, specifically: The preprocessing includes one or more of moving average smoothing, standard normal transformation, Savitzky-Golay convolution, and SG convolution first-order differential; when the data is preprocessed, the original data is retained as a control; The moving average smoothing reduces the noise and detail variation of the data by calculating the average value of a series of consecutive data points; The standard normal transformation is used to reduce the interference of uncertainty factors such as scattering effect and instrument response; The Savitzky-Golay convolution uses a sliding window to perform a convolution operation to reduce noise and interference signals in the spectrum while retaining the smooth characteristics of the spectrum; The SG convolution first-order differential is a method that combines Savitzky-Golay convolution smoothing and first-order differential. The SG method is used to smooth the data to reduce noise, and then the first-order differential is applied to the smoothed data to extract features.
6. The nondestructive detection method for tomato yellow leaf curl disease based on hyperspectral imaging technology according to claim 1, characterized in that: The feature extraction of the pre-processed hyperspectral data to obtain the key wavelength with the largest contribution to the feature is specifically as follows: First, the principal component analysis algorithm is used for dimensionality reduction and feature extraction, including the following steps: Use the training data to fit the PCA object, calculate the principal components and the corresponding explained variance, and obtain the reduced-dimensional data; According to the PCA results, the first n wavelengths with the largest weights are selected. These wavelengths correspond to the features that contribute most to the principal component and are called key wavelengths. Secondly, the continuous projection algorithm is used for feature extraction, specifically: Define a class called SPA to implement the continuous projection algorithm for feature selection; Randomly select the first feature as the starting point, and iteratively select the new feature with the largest projection to the selected feature until the required number of features are selected; Instantiate the SPA class, call the implementation method, use the training set data to perform feature selection, and obtain the selected feature index; The feature extraction using competitive adaptive reweighting algorithm comprises the following steps: Define a class named CARS to implement the competitive adaptive reweighted sampling algorithm for feature selection, initialize the class instance, set the support vector machine SVC as the estimator, and select the number of features to be selected; Implement the core logic of the CARS algorithm: Use the given estimator SVC to train the complete data set, and calculate the importance of the features based on the training results; the coefficients in the SVC determine the direction of the classification hyperplane. The larger the absolute value of the coefficient, the greater the influence of the corresponding feature on the classification boundary. Therefore, the absolute value of the SVC coefficient is used as the feature importance indicator; Iterate multiple times, update the feature counter each time a feature is selected, and finally select the n features with the most occurrences as the feature extraction results; Instantiate the CARS class, call the implementation method to perform feature selection using the training set data, and obtain the selected feature index. The principal component analysis algorithm helps to find the main trend of changes in the data by selecting the direction with the largest variance as the principal component, thereby extracting the key wavelengths in the process of hyperspectral data processing; The continuous projection algorithm is based on vector projection analysis and can quickly screen out the most representative characteristic wavelengths, thereby improving the efficiency of feature selection; The competitive adaptive reweighting algorithm reduces model instability through Monte Carlo resampling.
7. The nondestructive detection method for tomato yellow leaf curl disease based on hyperspectral imaging technology according to claim 1, characterized in that: Use the support vector machine model, partial least squares discriminant analysis model and gradient boosting machine model to classify diseased samples and healthy samples, that is, use the hyperspectral data after the above processing and key wavelength extraction as the input of the model to train the classification prediction model to establish a trained classification model; The processing of the support vector machine model is specifically as follows: Initialize the SVM model and define the hyperparameter range, including the penalty coefficient C, kernel function kernel, kernel function parameter gamma, and whether to use probability estimation probability; Traverse the defined hyperparameter grid, perform cross-validation scoring on each set of hyperparameter combinations, and record the best parameter combination and the corresponding highest score; Use the SVM model with the best parameters to perform cross-validation prediction and obtain the prediction results; The processing of the partial least squares discriminant analysis model is specifically as follows: The PLS-DA model is trained using standardized data and encoded labels. PLS-DA captures the most important variability in the data by constructing components. When constructing each component, PLS-DA finds the most significant correlation between the explanatory variable and the response variable by maximizing the covariance between the component score and the response variable. Through the extracted components, the PLS-DA model reduces the high-dimensional data space to a lower-dimensional space and uses linear discriminant analysis to train the classification model. The processing of the gradient boosting machine model is specifically as follows: The gradient boosting machine iteratively integrates multiple weak learners. At each step, the newly integrated tree is trained on the residual of the previous step model to gradually reduce the overall prediction error. The learning rate parameter is used to control the contribution of each tree to the final prediction, and the early stopping mechanism is used to prevent overfitting, and finally a strong learner is formed. The performance of the GBM model is optimized by minimizing the differentiable loss function and its generalization ability is evaluated under the cross-validation framework; Stratified 3-fold cross validation was defined using StratifiedKFold to ensure that the proportion of classes in each fold was roughly the same.
8. A nondestructive detection system for tomato yellow leaf curl disease based on hyperspectral imaging technology, characterized in that: A nondestructive detection method for tomato yellow leaf curl disease based on hyperspectral imaging technology applied to any one of claims 1 to 7, comprising a data acquisition module, a correction module, a region of interest extraction module, a preprocessing module, a feature extraction module, a model training module and a detection module; The data acquisition module is used to acquire hyperspectral imaging data of tomato leaf samples, wherein the tomato leaf samples include healthy samples and diseased samples infected with tomato yellow leaf curl disease; The correction module is used to perform black-white correction on the hyperspectral imaging data, and the hyperspectral data after black-white correction is normalized data; The region of interest extraction module is used to extract the region of interest from the hyperspectral image data after black-and-white correction to obtain reflectance information corresponding to different bands; The preprocessing module is used to preprocess the hyperspectral data after the region of interest is extracted to construct a data set required for machine learning model training; The feature extraction module is used to extract features from the pre-processed hyperspectral data to obtain the key wavelength with the largest contribution to the features; The model training module is used to establish a support vector machine (SVM) model, a partial least squares discriminant analysis (PLS-DA) model, and a gradient boosting machine (GBM) model, and train the three models using the processed hyperspectral data to obtain a tomato yellow leaf curl disease detection model; The detection module is used to input the tomato leaf sample to be detected into the tomato yellow leaf curl disease detection model to detect the tomato yellow leaf curl disease.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores computer program instructions that can be executed by the at least one processor, and the computer program instructions are executed by the at least one processor so that the at least one processor can execute the non-destructive detection method of tomato yellow leaf curl disease based on hyperspectral imaging technology as described in any one of claims 1-7.
10. A computer-readable storage medium storing a program, characterized in that: When the program is executed by a processor, the nondestructive detection method of tomato yellow leaf curl disease based on hyperspectral imaging technology as described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Areca leaf yellowing symptom analysis method and system based on 3D convolutional neural network
CN118887525A
Cited By
Facility vegetable feature extraction method, device, equipment and medium
CN122364849A