Potato disease and pest classification method, system and equipment and storage medium
Through hyperspectral data processing and feature wavelength selection, a plant spectral pest classification model of the support vector machine classifier was constructed, which solved the problems of low accuracy and efficiency in potato pest classification, and achieved efficient and accurate pest monitoring.
Patent Information
- Application Number
- CN202411519946.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-29
- Publication Date
- 2025-02-18
AI Technical Summary
The prior art has problems of low accuracy and detection efficiency in the classification of potato pests and diseases, and requires a lot of manual labeling.
By obtaining the hyperspectral data of potato leaves, using competitive adaptive reweighting sampling method, continuous projection algorithm and genetic algorithm to select characteristic wavelengths, a plant spectral pest classification model of support vector classifier is constructed to achieve efficient classification of potato pests and diseases.
It improves the accuracy and detection efficiency of potato pest classification, reduces manual labeling, and achieves efficient and non-destructive pest monitoring.
Smart Images

Figure CN119478678A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of agriculture, and in particular relates to a potato pest and disease classification method, system, equipment and storage medium. Background Art
[0002] Potato is the fourth largest food crop in my country after wheat, corn and rice. The high and stable yield of potato is of great significance to ensuring my country's food security. Inner Mongolia is one of the important production areas for potato cultivation. Early blight and ladybug pests pose a great threat to potato production in Inner Mongolia. Although early blight of potato mainly occurs in the late growth period of potato, excessively severe disease will seriously affect potato yield. Therefore, studying the efficient and non-destructive monitoring of potato disease and pest stress is of great significance for the prevention and control of potato diseases and pests.
[0003] The traditional detection method is mainly for experienced potato farmers to identify with the naked eye, but due to the wide range of potato planting and the irregular onset time, this method is time-consuming and labor-intensive. Chemical methods have higher detection accuracy, but are time-consuming and expensive, and are not as convenient and fast as naked eye detection. At present, certain research progress has been made in the identification and classification of pests and diseases of various crops based on machine vision. However, such experiments often require a large number of RGB images for long-term model training, accompanied by time-consuming and labor-intensive manual labeling. Therefore, the above-mentioned methods for potato disease classification and detection have the problems of requiring a lot of manpower, being time-consuming and labor-intensive, and the efficiency of disease classification and detection accuracy are low. Summary of the invention
[0004] In order to solve the problem of improving the accuracy and detection efficiency of potato pest classification through characteristic wavelengths, the present invention provides a potato pest classification method, system, device and storage medium.
[0005] In order to achieve the above object, the present invention provides the following technical solutions:
[0006] A method for classifying potato pests and diseases, comprising the following steps:
[0007] Acquire hyperspectral data of potato leaves, wherein the hyperspectral data specifically includes original spectral data and category labels;
[0008] Selecting characteristic wavelengths of the original spectral data by using a competitive adaptive reweighted sampling method and a continuous projection algorithm, and then performing secondary feature selection on the processed characteristic wavelengths by using a genetic algorithm to output the characteristic wavelengths;
[0009] The support vector machine classifier is trained by using the characteristic wavelength as input and the category label as output to obtain a plant spectral pest classification model;
[0010] The potato leaf image to be detected is input into the plant spectral pest and disease classification model, and the potato disease classification result is output.
[0011] Preferably, the original spectral data is subjected to characteristic wavelength selection through a competitive adaptive reweighted sampling method and a continuous projection algorithm, the obtained characteristic wavelengths are reorganized and deduplicated, and then secondary feature selection is performed on the original spectral data through a genetic algorithm to output the characteristic wavelengths, which specifically includes the following steps:
[0012] Feature selection is performed on the full-band data of the potato leaves by using a competitive adaptive reweighted sampling method and a continuous projection algorithm;
[0013] The competitive adaptive reweighted sampling method uses adaptive reweighted sampling to first take points with larger absolute values as new subsets and remove points with smaller absolute values, then re-establish the partial least squares model based on the processed subsets and perform multiple iterations to interactively verify that the wavelength in the subset with the smallest root mean square error is the optimal characteristic wavelength;
[0014] The continuous projection algorithm first selects an initial wavelength, calculates its projection on other unselected wavelengths, adds the unselected wavelength corresponding to the maximum projection to the wavelength combination, establishes a partial least squares model and calculates the root mean square error, and the wavelength with the minimum root mean square error is taken as the optimal wavelength combination;
[0015] The results obtained by the adaptive reweighted sampling method and the continuous projection algorithm are reorganized and deduplicated to obtain the deduplicated characteristic wavelength;
[0016] The genetic algorithm is used to perform secondary feature selection on the characteristic wavelength after deduplication, and the characteristic wavelength is output.
[0017] Preferably, the method further comprises preprocessing the hyperspectral data by using a multivariate scatter correction (MSC) method before performing feature selection.
[0018] Preferably, the hyperspectral data of potato leaves is obtained by acquiring a hyperspectral image of potato leaves, manually selecting a pixel area as a region of interest, calculating the average reflectance of the region of interest as original spectral data, and marking the categories of healthy leaves, early blight leaves, and insect-infested leaves respectively; wherein the hyperspectral image of potato leaves is obtained by the Wuling Optical HSI system.
[0019] Preferably, it also includes optimizing the parameters of the plant spectral pest and disease classification model using a real number coding genetic algorithm to determine the optimal individual decoding; wherein the processing process of the real number coding genetic algorithm specifically includes: inputting the hyperspectral data of the potato leaves and initializing them, obtaining the individual fitness through fitness function calculation, selecting individuals to update the population according to the arithmetic crossover method and using a single point mutation method to mutate individual genes, repeatedly calculating the individual fitness, judging whether the population number reaches the maximum threshold, and determining the optimal individual decoding.
[0020] Preferably, before the potato leaf image to be detected is input into the plant spectral pest and disease classification model, the plant spectral pest and disease classification model is also evaluated, and the model is evaluated using overall accuracy, confusion matrix and kappa coefficient.
[0021] The present invention also provides a potato pest classification system, which specifically comprises:
[0022] The data module is used to obtain the hyperspectral data of potato leaves, wherein the hyperspectral data specifically includes original spectral data and category labels.
[0023] The feature module is used to select the characteristic wavelength of the original spectral data through the competitive adaptive reweighted sampling method and the continuous projection algorithm, and then perform secondary feature selection on the processed characteristic wavelength through the genetic algorithm and output the characteristic wavelength.
[0024] The model module is used to train a support vector machine classifier using the characteristic wavelength as input and the category label as output to obtain a plant spectral pest and disease classification model.
[0025] The disease classification module is used to input the potato leaf image to be detected into the plant spectral disease and insect pest classification model and output the potato disease classification result.
[0026] The present invention also provides a computer device, comprising a memory, a processor and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps described in the potato pest classification method.
[0027] The present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is loaded by a processor, the steps described in the potato pest classification method can be executed.
[0028] The potato pest classification method provided by the present invention has the following beneficial effects:
[0029] The present invention obtains the original spectral data and category labels of potato leaves by acquiring a hyperspectral image of potato leaves. The original spectral data is subjected to characteristic wavelength selection using a competitive adaptive reweighted sampling method, a continuous projection algorithm and a genetic algorithm, and a CARS-SPA-GA feature selection method is proposed, that is, the characteristic wavelengths selected by the first two algorithms are reorganized and deduplicated, and then secondary feature selection is performed using a GA algorithm. The obtained characteristic wavelengths reduce the complexity of the data while containing more comprehensive important information. The characteristic wavelengths and category labels are input into a support vector machine classifier for training to obtain a plant spectral pest classification model, and the potato leaf image to be detected is input into a plant spectral pest classification model to obtain a classification result. Compared with machine vision pest identification, the present invention reduces manual labeling work by training a potato pest classification model using visible or near-infrared spectral data, and improves the accuracy and detection efficiency of potato pest classification. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to more clearly illustrate the embodiment of the present invention and its design scheme, the following briefly introduces the drawings required for this embodiment. The drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0031] Figure 1 The present invention is a flow chart of a method for classifying potato pests and diseases.
[0032] Figure 2 A flow chart for feature selection of the present invention.
[0033] Figure 3 : is the number of wavelengths and the root mean square error in the characteristic wavelength selection process based on CARS in the embodiment of the present invention.
[0034] Figure 4 This is a characteristic wavelength distribution diagram selected by CARS in an embodiment of the present invention.
[0035] Figure 5 This is a characteristic wavelength distribution diagram selected by SPA in an embodiment of the present invention.
[0036] Figure 6 This is a comparison diagram of the characteristic wavelength distribution selected by CARS and SPA in the embodiment of the present invention.
[0037] Figure 7 This is a characteristic wavelength distribution diagram selected by CARS-SPA-GA in an embodiment of the present invention.
[0038] Figure 8 It is a comparison diagram of the spectral curves of three types of potato leaves of the present invention.
[0039] Fig. 9The characteristic wavelength selected for CARS-SPA-GA of the present invention is based on the confusion matrix of different models, where: Fig. 9 (a) is the confusion matrix of the characteristic wavelength selected by CARS-SPA-GA based on the RCGA-SVC model; Fig. 9 (b) is the confusion matrix of the characteristic wavelength selected by CARS-SPA-GA based on the RCGA-RFC model; Fig. 9 (c) is the confusion matrix of the characteristic wavelength selected by CARS-SPA-GA based on the RCGA-RFC model. DETAILED DESCRIPTION
[0040] In order to enable those skilled in the art to better understand the technical solution of the present invention and implement it, the present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and cannot be used to limit the scope of protection of the present invention.
[0041] Example
[0042] As the research on UAV hyperspectral imaging technology in the field of monitoring crop growth conditions has gradually deepened, the use of UAVs equipped with hyperspectral cameras, multispectral cameras, thermal infrared cameras and other equipment to remotely sense and monitor the stress of field crop pests and diseases has gradually been popularized, greatly improving the efficiency of disease monitoring. Therefore, the present invention provides a potato pest classification method, such as Figure 1 As shown, the specific steps include:
[0043] S1. Obtain hyperspectral images of potato leaves. Using the Wuling Optical HSI system, spectral information in the range of 382.2358-1004.7804nm can be obtained, with 428 bands and a spectral resolution of 2.8nm. It is carried out in a dark box. The system includes a hyperspectral image spectrometer, a CCD camera, two 150W halogen lamps, a DC adjustable light source, a mobile control platform and a computer. First, a black and white correction is performed with the help of a homemade whiteboard to eliminate the influence of background, dark current and uneven illumination on reflectivity. The calculation formula is as follows:
[0044]
[0045] Where R is the relative spectral reflectance of the potato leaf sample, I S is the original spectrum intensity of potato leaves collected, I D is the reflection spectrum intensity of the reference blackboard, I W is the reflection spectrum intensity of the homemade white board.
[0046] The internal structure, chlorophyll and water content of plant leaves determine their spectral characteristics. The average spectral curves of the three types of leaves are as follows: Figure 8As shown, due to the strong absorption of chlorophyll on blue and red light, and weak absorption of green light, healthy potato leaves form obvious absorption peaks near the blue light absorption band of 480nm and the red light absorption band of 680nm, and form obvious reflection peaks near the green light area of 550nm. The spectral curves of the three types of potato leaves are roughly similar: there is an obvious absorption peak at 680nm, and the reflectivity rises sharply due to the "red edge effect" at 680-750nm, showing that the reflectivity of the near-infrared region on the right side of the "red edge" is significantly higher than that of the visible light region on the left side of the "red edge". In the range of 450-580nm, the healthy leaves are much higher than the diseased and insect-infested leaves. At 550nm, a reflection peak is formed in the healthy leaves, while the diseased and insect-infested leaves are relatively flat. This may be because the diseased and insect-infested leaves are damaged, and the chlorophyll is decomposed into lutein and lutein, which enhances the absorption of blue-violet light and has a low reflectivity. Chlorophyll is the main absorber of red light. In the red light range of 580-720nm, the leaves of pests and diseases are damaged, and the chlorophyll content decreases, which reduces the absorption of red light by the leaves, resulting in a higher reflectivity than healthy leaves. In the red light and near-infrared region to the right of 720nm, the reflectivity of diseased leaves is lower than that of healthy leaves because the cell structure of the diseased leaves is damaged, which affects the reflectivity.
[0047] S2. Extract the region of interest in the hyperspectral image of potato leaves, obtain the hyperspectral data of potato leaves, and preprocess the hyperspectral data of potato leaves. Use ENVI5.3 to open the leaf hyperspectral image, and manually select a 10*10 pixel area as the region of interest ROI. Calculate the average reflectance of the ROI as the original spectral data and mark the category, where healthy leaves are marked as 0, early blight leaves are marked as 1, and insect-infested leaves are marked as 2.
[0048] S3. Preprocess the hyperspectral data of potato leaves. Hyperspectral data are easily affected by environmental and instrument noise, so five preprocessing methods, namely convolution smoothing (SG), standard normal variable transformation (SNV), multivariate scatter correction (MSC), minimum maximum standardization (MMS), and wavelet transform (WT), were used to preprocess the data.
[0049] Table 1 Comparison of six preprocessing methods on different classifiers
[0050]
[0051]
[0052] Pretreatment can reduce the interference of noise in the data and improve the classification accuracy. It can be concluded from the comparative experiment that the five pretreatment methods such as SG, SNV, and MSC used in the present invention can eliminate the obvious noise in the spectrum. As shown in Table 1, the data processed by the SG method has outstanding effects on the SVC classifier, while the data processed by the MSC method can obtain higher accuracy rates in both SVC and RF classifiers. Therefore, using the MSC method to pretreat the data is the best pretreatment method of the present invention, which can achieve better processing effects.
[0053] S4, feature selection is performed on the pre-processed hyperspectral data of potato leaves, and characteristic wavelengths are output. The present invention uses a competitive adaptive reweighted sampling method CARS, a continuous projection algorithm SP and a genetic algorithm GA to perform feature selection on the pre-processed full-band data.
[0054] CARS combines the idea of importance sampling in Monte Carlo sampling with the regression coefficient of the partial least squares (PLS) model, and takes the absolute value of the regression coefficient in the PLS model as the object of importance evaluation. First, through adaptive reweighted sampling, the points with larger absolute values are used as new subsets, and the points with smaller absolute values are eliminated. Then, the PLS model is rebuilt based on the current subset. After multiple iterations, the wavelength in the subset with the smallest root mean square error (RMSE) is interactively verified by the PLS model as the optimal characteristic wavelength.
[0055] The present invention adopts 10-fold cross validation and sets the number of Monte Carlo sampling to 100. Figure 3 As shown in Figure 2, when the model is iterated 35 times, the RMSE of the model is the smallest, and 64 characteristic wavelengths are obtained, whose distribution is as follows: Figure 4 As shown, it is mainly concentrated in 425-705nm and 745-750nm.
[0056] The continuous projection algorithm SPA is a forward iterative search algorithm. Based on the selected initial wavelength, its projection on other unselected wavelengths is calculated, and the unselected wavelength corresponding to the maximum projection is added to the wavelength combination. The PLS model is established and the RMSE is calculated. The wavelength combination with the minimum RMSE is the optimal wavelength combination.
[0057] In the present invention, the range of the number of features selected by SPA is set to 20-50, and the optimal wavelength combination obtained includes 20 wavelengths, which are distributed as follows: Figure 5 As shown, it is mainly concentrated in four areas: 385-400nm, 505-580nm, 820-865nm, and 950-995nm.
[0058] Table 2 Comparison of different feature selection methods on different models
[0059]
[0060]
[0061] As shown in Table 2, the accuracy and Kappa of the bands after feature selection by GA on the three models are improved or the same, among which the OA of SVC and RF on the test set are improved by more than 0.6%, and the number of bands after screening is reduced by half. Therefore, the redundant bands in the hyperspectral data of the present invention do interfere with the discrimination of the model. The accuracy and Kappa of the bands after feature selection by CARS on the three models have slight changes, among which the OA of SVC on the test set is improved by about 0.3%, and RF and ANN are reduced by about 0.3%. The OA of the bands screened by SPA on the three models has decreased by less than 4%. However, this change is in exchange for the number of bands screened by CARS being less than 15% of the full bands, and the number of bands screened by SPA being less than 5% of the full bands. This shows that the three feature selection algorithms can achieve good data dimensionality reduction effects without causing a large loss in accuracy. Especially when the GA and CARS algorithms are combined with the GA-SVC model, the model accuracy is also improved while the data dimension is reduced.
[0062] Since the OA of the two sets of characteristic wavelengths obtained by the two feature selection methods, CARS and SPA, on the GA-SVC model are both over 95%, it is clear that both sets of wavelengths contain important information. Figure 6 As shown in the comparison of the distribution of the two groups of characteristic wavelengths in the entire band, it can be found that there is almost no overlap between the features selected by the two algorithms, and there are great differences.
[0063] In order to obtain more comprehensive important features, the two sets of features were combined and deduplicated to obtain 82 characteristic wavelengths, which were subjected to secondary feature selection using GA, and finally 39 characteristic wavelengths were obtained. The distribution of characteristic wavelengths selected by CARS-SPA-GA is shown in the figure below: Figure 7 shown.
[0064] S5. Select a classifier to construct a plant spectral pest and disease classification model, and optimize the model parameters through a real-coded genetic algorithm.
[0065] Machine learning and deep learning models have been widely used in plant spectral data learning, including hyperspectral data of leaves, fruits, seeds, canopies, etc. Commonly used classifiers for such data include support vector machine SVM, random forest RF, artificial neural network ANN, partial least squares discriminant analysis, etc. The present invention selects an applicable algorithm from machine learning, ensemble learning, and deep learning for modeling, in order to explore a modeling algorithm that is more suitable for spectral data.
[0066] Support vector machine is a supervised learning algorithm suitable for small samples and high-dimensional data sets. Nonlinear problems can be effectively solved with the help of kernel functions. The radial basis kernel function is used in the present invention. The goal of SVC is binary classification. For the three-classification problem, a one-to-many strategy is adopted to train three binary classification models. In each model, one class of samples is used as a positive example, and the rest of the class samples are used as negative examples.
[0067] Random Forest RF is a representative supervised learning algorithm in ensemble learning. It consists of multiple decision tree classifiers, and the model output is the final result after the classification results of all decision trees vote.
[0068] Artificial neural network ANN, also called multi-layer perceptron MLP, is a deep learning algorithm that simulates the neural network work of the human brain. The ANN model established by the present invention consists of three layers: input layer, hidden layer, and output layer. The number of neurons in the input layer is consistent with the number of input bands, and the output layer has 3 neurons, which is consistent with the number of sample categories, representing healthy potato leaves, potato leaves stressed by early blight, and potato leaves stressed by ladybug pests.
[0069] Table 3 Comparison of CARS-SPA-GA and classic feature selection methods on different models
[0070]
[0071] As shown in Table 3, compared with the feature groups selected by the single CARS method and the SPA method, the number of features selected by the CARS-SPA-GA method is between the two, and the OA and kappa obtained by inputting into three different types of models are the highest. Only GA is used for wavelength selection to obtain features that account for 50% of the entire band. The CARS-SPA-GA method, that is, GA is used to perform secondary selection on all feature wavelengths selected by CARS and SPA, and the selected features are significantly less, less than 10% of the entire band. Compared with the single GA method, the accuracy only drops by about 1% at most, and the accuracy on the ANN model is also improved.
[0072] The characteristic wavelength selected by CARS-SPA-GA is input into the confusion matrix output by the three models as follows Fig. 9 As shown in Table 3, it can be found that for the same spectral data, the RCGA-SVC model as a plant spectral data model has a 100% accuracy rate for the classification of healthy data, and has some misjudgments for the two diseased and insect-infested leaves, showing a better classification effect among the three models.
[0073] The real-coded genetic algorithm (RCGA) is used to optimize the model parameters, including the penalty coefficient C and kernel function coefficient gamma of SVC, the number of classifiers and maximum depth of RF, the learning rate and number of hidden unit layers and neurons of ANN, the number of principal components and maximum number of iterations of PLS-DA, etc. Taking SVC as an example, the process of optimizing parameters using the real-coded genetic algorithm is as follows: Figure 5 shown.
[0074] The specific steps of optimizing the parameters of the SVC classification model using the real-coded genetic algorithm are as follows:
[0075] (1) Input the potato leaf hyperspectral data and label data into the SVC classifier;
[0076] (2) Initialize the parameters of the real-number coded genetic algorithm, generate an initial population including parameters C and gamma, and encode them;
[0077] (3) Calculate the classification accuracy as individual fitness based on the fitness function;
[0078] (4) Determine whether the current population size has reached the threshold value. If it has not reached the maximum value, proceed to step (5); if it has reached the maximum value, proceed to step (8);
[0079] (5) Selecting individuals using the roulette wheel method;
[0080] (6) Perform crossover between individuals according to the arithmetic crossover method to update the population. The arithmetic crossover formula is as follows:
[0081] X′ ij =αX ij +(1-α)X (i+1)j .
[0082] X′ (i+1)j =(1-α)X ij +αX (i+1)j .
[0083] (7) Single-point mutation is used to mutate individual genes. The calculation formula is as follows:
[0084] When θ is greater than 0.5,
[0085]
[0086] When θ is less than or equal to 0.5,
[0087]
[0088] Among them, X ij is the j gene of the current i individual, X′ ij is the j gene of individual i after mutation, X maxand X min are the upper and lower limits of the j-bit gene, T is the maximum number of evolutions, t is the current number of evolutions, θ and r are random numbers in the range [0,1]. Then repeat steps (3) and (4).
[0089] (8) Decode the current optimal individual and output it as parameters C and gamma.
[0090] The present invention uses overall accuracy (OA), confusion matrix, and kappa coefficient to evaluate the model.
[0091] The overall accuracy is a common evaluation indicator for measuring the performance of a classifier. Its calculation formula is as follows:
[0092]
[0093] Among them, T0, T1, and T2 are the number of samples correctly classified in each category, and N0, N1, and N2 are the number of samples incorrectly classified in each category;
[0094] The confusion matrix is a visualization tool that can present the classification results of the model;
[0095] The Kappa coefficient is different from OA, which only considers the correctly classified samples. It is a measurement indicator based on the confusion matrix and also takes into account the impact of misclassified samples. Its calculation formula is as follows:
[0096]
[0097] p e The calculation formula is as follows:
[0098]
[0099] Among them, a1, a2, and a3 represent the actual number of samples in each category, b1, b2, and b3 represent the predicted number of samples in each category, and n represents the total number of samples.
[0100] S6. Output the classification results of potato pests and diseases.
[0101] The present invention also provides a potato disease classification system, comprising:
[0102] The data module is used to obtain the hyperspectral data of potato leaves. The hyperspectral data specifically includes the original spectral data and category labels.
[0103] The feature module is used to select the characteristic wavelength of the original spectral data through the competitive adaptive reweighted sampling method and the continuous projection algorithm, and then perform secondary feature selection on the processed characteristic wavelength through the genetic algorithm and output the characteristic wavelength.
[0104] The model module is used to train the support vector machine classifier by taking the characteristic wavelength as input and the category label as output to obtain a plant spectral pest and disease classification model.
[0105] The disease classification module is used to input the potato leaf image to be detected into the plant spectral pest and disease classification model and output the potato disease classification result.
[0106] Each module in the above potato disease classification system can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0107] The present invention also provides a computer device, including a memory, a processor and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps in an embodiment of a method for classifying potato pests and diseases. The specific implementation method can be found in the method embodiment, which will not be described in detail here.
[0108] Furthermore, the present invention also provides a non-temporary computer-readable storage medium containing instructions, and a computer program is stored on the storage medium. For example, a memory containing instructions, the above instructions can be executed by a processor of a computer device to complete the above method. For example, the non-temporary computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device. When the computer program is executed by the processor, the steps in an embodiment of a potato pest classification method can be implemented. The specific implementation method can be found in the method embodiment, which will not be repeated here.
[0109] It will be appreciated by those skilled in the art that embodiments of the present invention may provide methods, systems or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0110] The present invention is described with reference to flowcharts and / or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as a combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0111] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0112] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0113] It should be pointed out that the specific implementation methods described above can enable those skilled in the art to understand the invention more comprehensively, but do not limit the invention in any way. Therefore, although the invention has been described in detail in this specification and embodiments, those skilled in the art should understand that the invention can still be modified or replaced by equivalents; and all technical solutions and improvements that do not deviate from the spirit and scope of the invention are included in the protection scope of the patent for the invention. Any figure mark in the claims should not be regarded as limiting the claims involved. Any simple change or equivalent replacement of the technical solution that can be obviously obtained by any technician familiar with the field within the technical scope disclosed in the present invention belongs to the protection scope of the present invention.
Claims
1. A method for classifying potato pests and diseases, characterized in that: The following steps are involved: Acquire hyperspectral data of potato leaves, wherein the hyperspectral data specifically includes original spectral data and category labels; Selecting characteristic wavelengths of the original spectral data by using a competitive adaptive reweighted sampling method and a continuous projection algorithm, and then performing secondary feature selection on the processed characteristic wavelengths by using a genetic algorithm to output the characteristic wavelengths; The support vector machine classifier is trained by using the characteristic wavelength as input and the category label as output to obtain a plant spectral pest classification model; The potato leaf image to be detected is input into the plant spectral pest and disease classification model, and the potato pest and disease classification result is output.
2. A potato pest classification method according to claim 1, characterized in that: The original spectral data is subjected to characteristic wavelength selection by a competitive adaptive reweighted sampling method and a continuous projection algorithm, the obtained characteristic wavelengths are reorganized and deduplicated, and then the characteristic wavelengths after deduplication are subjected to secondary feature selection by a genetic algorithm and then output, which specifically includes the following steps: The feature selection is performed on the full-band data of the potato leaves by using a competitive adaptive reweighted sampling method and a continuous projection algorithm; The competitive adaptive reweighted sampling method uses adaptive reweighted sampling to first take points with larger absolute values as new subsets and remove points with smaller absolute values, then re-establish the partial least squares model based on the processed subsets and perform multiple iterations to interactively verify that the wavelength in the subset with the smallest root mean square error is the optimal characteristic wavelength; The continuous projection algorithm first selects an initial wavelength, calculates its projection on other unselected wavelengths, adds the unselected wavelength corresponding to the maximum projection to the wavelength combination, establishes a partial least squares model and calculates the root mean square error, and the wavelength with the minimum root mean square error is taken as the optimal wavelength combination; The results obtained by the adaptive reweighted sampling method and the continuous projection algorithm are reorganized and deduplicated to obtain the deduplicated characteristic wavelength; The genetic algorithm is used to perform secondary feature selection on the characteristic wavelength after deduplication, and the characteristic wavelength is output.
3. A potato pest classification method according to claim 1, characterized in that: The method also includes preprocessing the hyperspectral data by using a multivariate scatter correction (MSC) method before performing feature selection.
4. A potato pest classification method according to claim 1, characterized in that: The hyperspectral data of potato leaves are obtained by obtaining a hyperspectral image of potato leaves, manually selecting a pixel area as a region of interest, calculating the average reflectance of the region of interest as raw spectral data, and marking the categories of healthy leaves, early blight leaves, and insect-infested leaves respectively; The potato leaf hyperspectral image is obtained by the Wuling Optical HSI system.
5. A potato pest classification method according to claim 1, characterized in that: It also includes optimizing the parameters of the plant spectral pest and disease classification model using a real number coding genetic algorithm to determine the optimal individual decoding; wherein the processing process of the real number coding genetic algorithm specifically includes: inputting the hyperspectral data of the potato leaves and initializing them, obtaining the individual fitness through fitness function calculation, selecting individuals to update the population according to the arithmetic crossover method and using a single point mutation method to mutate individual genes, repeatedly calculating the individual fitness, judging whether the population number reaches the maximum threshold, and determining the optimal individual decoding.
6. A potato pest classification method according to claim 1, characterized in that: Before the potato leaf image to be detected is input into the plant spectral pest and disease classification model, the plant spectral pest and disease classification model is also evaluated, and the model is evaluated using overall accuracy, confusion matrix and kappa coefficient.
7. A potato pest classification system, characterized in that: include: A data module, used to obtain hyperspectral data of potato leaves, wherein the hyperspectral data specifically includes original spectral data and category labels; A feature module is used to select characteristic wavelengths of the original spectral data by using a competitive adaptive reweighted sampling method and a continuous projection algorithm, and then perform secondary feature selection on the processed characteristic wavelengths by using a genetic algorithm and then output the characteristic wavelengths; A model module, used to train a support vector machine classifier using the characteristic wavelength as input and the category label as output to obtain a plant spectral pest classification model; The disease classification module is used to input the potato leaf image to be detected into the plant spectral disease and insect pest classification model and output the potato disease classification result.
8. A computer device comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is loaded into a processor, it can execute the steps of the method according to any one of claims 1 to 6.
Citation Information
Cited By
Pit mud total nitrogen content detection method based on combination of hyperspectral technology and hybrid algorithm
CN121096471A
Method for detecting total nitrogen content of pit mud based on hyperspectral technology combined with mixing algorithm
CN121096471B