Tobacco leaf mildew detection method based on hyperspectrum
By constructing a hyperspectral image database and classification model of tobacco leaves, the problem of difficult to predict and monitor mold in the existing technology is solved, efficient and accurate mold detection of tobacco leaves is achieved, early warning capabilities are provided, and the scientificity and systematicity of tobacco leaves quality control are improved.
Patent Information
- Application Number
- CN202411492641.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-24
- Publication Date
- 2025-03-07
AI Technical Summary
The existing technology is difficult to effectively predict and monitor mold in tobacco leaves, especially in the early stages, and lacks systematic research and efficient detection methods.
A hyperspectral-based tobacco leaf mold detection method was used to obtain the hyperspectral images of tobacco leaf samples, and a tobacco leaf hyperspectral image database was constructed, and a tobacco leaf mold classification model was constructed based on this database to achieve the mold classification and identification of tobacco leaf to be tested.
It has achieved rapid, accurate and non-destructive mold detection of tobacco leaves, significantly improved the detection speed and accuracy, and has early warning capabilities. It can effectively predict the mold condition of tobacco leaves, reduce the risks brought by mold, and improve the scientificity and systematicity of tobacco leaves quality control.
Smart Images

Figure CN119574579A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of tobacco leaf classification and identification, and in particular to a tobacco leaf mildew detection method based on hyperspectral. Background Art
[0002] Tobacco is a special leaf plant with great economic value. The storage and transportation of tobacco also play an extremely important role in the tobacco storage process. After a series of links such as field growth, harvesting, baking, acquisition, transportation, leaf beating and re-baking, and aging, tobacco leaves can enter the silk-making workshop of the cigarette factory and finally be rolled into cigarettes. Generally speaking, it takes at least 1 to 2 years from tobacco leaf harvesting to cigarette rolling. However, there are serious problems in the tobacco storage process, among which mold is one of the most widely distributed fungal microorganisms in nature. As long as the environmental temperature and humidity are suitable, mold will multiply rapidly, causing the tobacco leaves to become moldy, and then rot and deteriorate.
[0003] There are many factors that cause tobacco mildew, including the temperature and humidity of the storage environment and the moisture content of the tobacco itself. In addition, due to differences in different regions, tobacco types, bacterial species and quantities, the tobacco mildew process is nonlinear and uncertain. At present, the monitoring of tobacco mildew mainly focuses on the identification of mold species, mycotoxin detection, and the determination of mold biomass using chitin and ergosterol. However, there is still a lack of systematic research on the early prediction of tobacco leaf mildew.
[0004] Near infrared spectroscopy has developed rapidly in recent years. It is an analytical method based on the absorption characteristics of the spectrum by chemical composition. This technology does not require complex sample pretreatment and has the advantages of being fast, simple, highly accurate, low-cost and non-destructive. It is widely used in the monitoring and research of the quality of various agricultural products. In the tobacco industry, near infrared spectroscopy has been successfully used to qualitatively detect tobacco mildew. Researchers established a pattern recognition model for the mildew process of tobacco leaves by analyzing the changes in ergosterol content of tobacco leaves based on near infrared spectroscopy and combining chemometric methods. This method uses process pattern recognition to monitor the changes in ergosterol content in the mildew process of primary flue-cured tobacco leaves for a single tobacco leaf sample, which can effectively eliminate the influence of regional, part and grade differences in tobacco leaves on the model. However, since this method also has limitations, it is still necessary to re-establish the model for early warning of mildew of tobacco leaves from different origins, parts and grades. Another method uses a near infrared spectrometer to collect the near infrared spectrum of tobacco leaves and establishes a least squares discriminant analysis model for predicting mildewed tobacco leaves. However, this model only judges the moldy tobacco leaf samples and the normal tobacco leaf samples, and does not consider the prediction of tobacco leaves that are about to become moldy.
[0005] In view of this, the inventor, based on many years of experience in production design in this field and related fields, has designed a method for detecting tobacco leaf mildew based on hyperspectral after repeated experiments, in order to solve the problems existing in the prior art. Summary of the invention
[0006] The purpose of the present invention is to provide a tobacco leaf mildew detection method based on hyperspectral, which can effectively predict the mildew condition of tobacco leaves.
[0007] In order to achieve the above-mentioned object of the invention, the present invention proposes a method for detecting tobacco leaf mildew based on hyperspectral, wherein the method for detecting tobacco leaf mildew comprises:
[0008] Obtaining hyperspectral images of tobacco leaf samples and constructing a tobacco leaf hyperspectral image database, wherein the tobacco leaf samples at least include normal tobacco leaves, tobacco leaves close to being moldy, and moldy tobacco leaves;
[0009] Based on the tobacco leaf hyperspectral image database, a tobacco leaf mildew classification model is constructed;
[0010] The tobacco leaf mildew classification model is used to classify and identify the mildew of the tobacco leaf to be tested.
[0011] Compared with the prior art, the present invention has the following characteristics and advantages:
[0012] The hyperspectral-based tobacco leaf mildew detection method proposed in the present invention realizes fast, accurate and non-destructive tobacco leaf mildew detection by integrating hyperspectral imaging technology and machine learning algorithm. It not only significantly improves the detection speed and accuracy and avoids damage to tobacco leaves, but also has the ability of early warning and can effectively predict the mildew of tobacco leaves, thereby providing the tobacco industry with an efficient detection solution with broad application prospects, helping to reduce the risks brought by mildew and improve the scientificity and systematicness of tobacco leaf quality control. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] The accompanying drawings described herein are only for explanation purposes and are not intended to limit the scope of the present invention in any way. In addition, the shapes and proportional dimensions of the various components in the figures are only schematic, used to help understand the present invention, and are not specifically limited to the shapes and proportional dimensions of the various components of the present invention. Those skilled in the art can select various possible shapes and proportional dimensions to implement the present invention according to the teachings of the present invention.
[0014] Figure 1 The present invention is a schematic diagram of the process of detecting tobacco leaf mildew;
[0015] Figure 2 A schematic diagram of the process of extracting hyperspectral data from a hyperspectral image according to the present invention;
[0016] Figure 3 Schematic diagram of the reflectivity extraction process in an embodiment of the present invention;
[0017] Figure 4 This is a schematic diagram of the distribution of the scores of the first three principal components of the samples in the embodiment of the present invention;
[0018] Figure 5 This is a schematic diagram of the original spectrum curve of tobacco leaves in an embodiment of the present invention;
[0019] Figure 6 It is a schematic diagram of average spectrum curves of the moldy area and the normal area in the embodiment of the present invention;
[0020] Figure 7 Schematic diagram of spectral reflectance curves of normal tobacco leaves and moldy tobacco leaves after pretreatment in an embodiment of the present invention;
[0021] Figure 8 Schematic diagram of load coefficients of PC1 and PC2 in an embodiment of the present invention;
[0022] Fig. 9 Schematic diagram of SPA characteristic wavelength selection results in an embodiment of the present invention;
[0023] Fig.10 It is a schematic diagram of the confusion matrix result of the SPA-RF model discrimination test set in an embodiment of the present invention;
[0024] Fig.11 Schematic diagram of visualizing classification results of different classifiers in an embodiment of the present invention;
[0025] Fig.12 Schematic diagram of the structure of a hyperspectral image acquisition device in an embodiment of the present invention.
[0026] Description of the accompanying drawings:
[0027] 10. Hyperspectral camera; 20. Halogen lamp;
[0028] 30. Test sample; 40. Electric stage;
[0029] 50. Computer; 60. Cabinet. DETAILED DESCRIPTION
[0030] The details of the present invention can be more clearly understood with reference to the accompanying drawings and the description of the specific embodiments of the present invention. However, the specific embodiments of the present invention described herein are only used for the purpose of explaining the present invention and cannot be understood as limiting the present invention in any way. Under the guidance of the present invention, technicians can conceive of any possible variations based on the present invention, which should all be considered to belong to the scope of the present invention.
[0031] The present invention proposes a method for detecting tobacco leaf mildew based on hyperspectral. Figure 1 As shown, the method includes: obtaining a hyperspectral image of a tobacco leaf sample and constructing a tobacco leaf hyperspectral image database, wherein the tobacco leaf samples include at least normal tobacco leaves, tobacco leaves close to being moldy, and moldy tobacco leaves; constructing a tobacco leaf mold classification model based on the tobacco leaf hyperspectral image database; and classifying and identifying moldy tobacco leaves to be tested using the tobacco leaf mold classification model.
[0032] The present invention proposes a method for detecting tobacco leaf mildew based on hyperspectral technology, which realizes fast, accurate and non-destructive detection of tobacco leaf mildew by integrating hyperspectral imaging technology and machine learning algorithm. It not only significantly improves the detection speed and accuracy and avoids damage to tobacco leaves, but also has the ability of early warning and can effectively predict the mildew of tobacco leaves.
[0033] In an optional embodiment of the present invention, a tobacco leaf mold classification model is constructed based on a tobacco leaf hyperspectral image database, including: extracting hyperspectral data from the hyperspectral image and preprocessing the hyperspectral data; selecting characteristic wavelengths for the preprocessed hyperspectral data and establishing a tobacco leaf mold classification model. First, the images in the tobacco leaf hyperspectral image database are analyzed in detail to extract key hyperspectral data. The hyperspectral data records the spectral reflectance characteristics of tobacco leaf samples in the visible to near-infrared range. Subsequently, a preprocessing step is performed on the extracted hyperspectral data.
[0034] In an optional example of this implementation, a standard normal variant (SNV) is used to preprocess the hyperspectral data. Preprocessing the hyperspectral data can reduce the impact of the external environment and improve the data signal-to-noise ratio.
[0035] Among them, the SNV algorithm can effectively eliminate the spectral variation between tobacco leaf samples caused by factors such as surface scattering and uneven distribution of particle size, and remove the noise caused by uneven surface distribution and particle scattering of tobacco leaf samples. Specifically, the spectral data of each pixel is first centered to make its mean zero; then, the standard deviation of the spectral data of each pixel is calculated and standardized to ensure that the spectral data of each pixel has unit variance. Through this process, not only the inhomogeneity between samples is removed, but also the useful information in the spectral data is retained, providing a more accurate and reliable data basis for the subsequent characteristic wavelength selection and classification model establishment.
[0036] The mathematical calculation formula of SNV can transform the original data into a standard normal distribution:
[0037]
[0038] Among them, f(x): This is the standard normal density function, which represents the probability density of the data falling at this point under a given x value. x: represents the input data, that is, the original data point to be converted. μ(mu): The mean value of the data, which indicates the central position of the data and reflects the central trend of the data distribution. σ(sigma): The standard deviation of the data, which measures the degree of dispersion of the data distribution, that is, the distribution of data points around the mean value. Through the above parameters, the SNV formula can convert the original data into a standard normal distribution with a mean of 0 and a standard deviation of 1, thereby eliminating the dimensional differences between different data sets and facilitating intuitive comparison and analysis of data. At the same time, the excellent mathematical properties of the standard normal distribution play an important role in statistics and data analysis.
[0039] In another optional example of this embodiment, the preprocessing operation can also use Min-Max Scaler (MMS), Multivariate Scattering Correction (MSC), Standard Scaler (SS), Mean Centering (CT), Moving Average (MA), Trend Correction (DT) or SG smoothing filter (Savitzky-Golay, SG) to perform data preprocessing operations on the hyperspectral spectrum.
[0040] Among them, MSC can reduce the difference in spectral data caused by diffuse reflection and enhance the spectral information corresponding to the effective ingredients; SS can eliminate the dimensional influence between indicators and ensure that different indicators have similar numerical ranges; CT can move the mean of data samples to zero to eliminate the overall offset of the data; MA can smooth time series data, reduce noise interference, and highlight trends; DT can reduce data variation caused by trends and highlight information unrelated to trends; SG uses smoothing processing combined with appropriate polynomial orders and smoothing moving windows to fit the spectral features within the moving window to eliminate baseline drift, tilt and other noise, and sets the polynomial order and smoothing moving windows.
[0041] In an optional example of this implementation, the SPA method is used to select characteristic wavelengths for the preprocessed data, so as to carefully select the bands with significant distinguishing power for tobacco leaf mildew, laying a solid foundation for building a classification model. Finally, combining the results of preprocessing and characteristic wavelength selection, a machine learning algorithm is used to build a tobacco leaf mildew classification model to achieve efficient recognition and classification of tobacco leaf mildew status.
[0042] Furthermore, the machine learning method may select a random forest algorithm, a softmax algorithm, or a support vector algorithm.
[0043] In an optional example of this embodiment, Figure 2 As shown, the hyperspectral data in the hyperspectral image is extracted, including: selecting the 920nm band image as the mask data, and using the maximum between-class variance method to perform binarization to construct the mask image; using the constructed mask image to mask the original hyperspectral image, and obtaining the region of interest of the hyperspectral image; extracting the spectral data of all pixels in the region of interest of the hyperspectral image as component discrimination research data, and selecting the data with a spectral wavelength range of 400 to 1100nm in the component discrimination research data as the hyperspectral data.
[0044] First, the 920nm band image is selected as the mask data. In this band, the spectral difference between the tobacco leaf sample and the background is the most significant. After the mask data is binarized using the maximum inter-class variance method, a high-contrast mask image can be constructed, which can accurately distinguish the tobacco leaf sample area from the background. Then, the constructed mask image is applied to the original hyperspectral image, and the region of interest (ROI) is extracted through the mask operation, which effectively reduces the impact of background noise on subsequent analysis and improves the pertinence of data processing. After obtaining the ROI, the spectral data of all pixels in the region are further extracted. The above spectral data constitutes the basis for the research on component discrimination of tobacco leaf mold detection. In addition, in order to ensure the relevance of the data and the accuracy of the analysis, the spectral data in the range of 400-1100nm are selected as the final hyperspectral data set. This wavelength range covers the key area of the spectral characteristics of tobacco leaves, providing high-quality input data for the subsequent feature wavelength selection and classification model establishment.
[0045] In this embodiment, the method for extracting hyperspectral data from a hyperspectral image realizes efficient extraction and processing of tobacco leaf hyperspectral image data. Using the 920nm band image as a mask and combining the maximum inter-class variance method for binarization processing significantly improves the distinction between tobacco leaves and the background, ensuring the accuracy of the mask image. The region of interest extracted by the mask operation eliminates the interference of irrelevant background, so that the spectral data is more focused on the tobacco leaves themselves, thereby enhancing the pertinence and reliability of subsequent analysis. The spectral data of 400 to 1100nm is selected as the analysis object. The selection of this range is based on an in-depth study of the spectral characteristics of tobacco leaves, ensuring that the data set contains the key spectral features in the process of tobacco leaf mildew. Therefore, the above-mentioned method for extracting hyperspectral data from a hyperspectral image not only improves the accuracy of data extraction, but also provides more abundant and accurate spectral information for tobacco leaf mildew detection, laying a solid foundation for establishing an efficient tobacco leaf mildew classification model.
[0046] In an optional example of this implementation, the hyperspectral data is preprocessed using the SNV algorithm.
[0047] Furthermore, the SPA algorithm is used to select characteristic wavelengths for the preprocessed hyperspectral data. Based on the preprocessed hyperspectral data, the SPA algorithm constructs a set of characteristic wavelengths containing the least redundant information by gradually selecting the wavelengths that contribute the most to the classification. Specifically, the SPA algorithm first randomly selects an initial wavelength, then calculates the orthogonal distance of the wavelength to all other wavelengths in the database, and selects the wavelength with the largest orthogonal distance as the first characteristic wavelength. Subsequently, the algorithm updates the projection of the remaining wavelengths, repeats the above process, and continues to select characteristic wavelengths until the predetermined number of characteristic wavelengths is reached. The SPA algorithm can screen out the most representative wavelengths from the hyperspectral data. These wavelengths can reflect the characteristics of tobacco leaf mildew to the greatest extent, providing key input variables for subsequent classification models.
[0048] Furthermore, the random forest algorithm is used to establish a classification model for tobacco leaf mold. After completing the preprocessing of hyperspectral data and the selection of characteristic wavelengths, the selected characteristic wavelength data is used as input, and the classification model is constructed using the random forest algorithm. Specifically, the number of decision trees is first determined, and then the training data is randomly sampled to form a training set for each decision tree. Each decision tree grows independently without pruning, and eventually forms a forest consisting of multiple decision trees. In the prediction stage, each decision tree gives its classification result, and the final classification decision is determined by voting or averaging. The integration characteristics of the random forest algorithm significantly improve the prediction accuracy of the model. Through the parallel processing of multiple decision trees, the risk of overfitting is reduced and the generalization ability of the model is enhanced. When processing hyperspectral data, the random forest algorithm can effectively capture the complex spectral characteristics of tobacco leaf mold and improve the ability to identify tobacco leaves at different moldy stages.
[0049] In an optional embodiment of the present invention, obtaining a hyperspectral image of a tobacco leaf sample includes: performing a tobacco leaf mildew experiment on multiple tobacco leaf samples, and regularly collecting hyperspectral images of multiple tobacco leaf samples during the tobacco leaf mildew experiment. First, multiple tobacco leaf samples (re-baked tobacco leaves) are selected as experimental materials. These tobacco leaf samples have been ensured to be of the same grade before the mildew experiment to ensure the consistency and comparability of the experimental results. During the experiment, the tobacco leaf samples are placed in a controllable environmental condition to simulate the environmental factors that the tobacco leaves may encounter during storage. Subsequently, a high-precision hyperspectral imaging system is used to regularly image these tobacco leaf samples to capture their spectral changes during the mildew process. This process involves collecting hyperspectral images of tobacco leaf samples at different time points, including multiple stages in the early, middle and late stages of mildew, to ensure that comprehensive hyperspectral spectral data is obtained. The collected hyperspectral images not only record the spectral reflectance characteristics of the tobacco leaf surface, but also analyze the chemical and physical changes inside the tobacco leaf through these hyperspectral data combined with the sampling of tobacco leaf samples, providing important information for tobacco leaf mildew detection.
[0050] In an optional example of this embodiment, obtaining a hyperspectral image of a tobacco leaf sample also includes: performing a cost analysis on the tobacco leaf sample and obtaining a principal component distribution; associating the principal component distribution with the hyperspectral image. Specifically, firstly, the tobacco leaf sample is comprehensively scanned using hyperspectral imaging technology to capture its spectral reflectance characteristics in the visible-near infrared range. Subsequently, the collected samples are processed using chemometric methods, and the principal component analysis (PCA) technology is used to reduce the dimensionality and extract the principal components that reflect the essential characteristics of the tobacco leaf samples. The above principal components not only represent the spectral characteristics of the tobacco leaf samples, but are also closely related to their physical and chemical properties.
[0051] Furthermore, the principal component distribution is associated with the hyperspectral image to achieve a deeper understanding of the tobacco leaf samples. The application of principal component analysis greatly simplifies the complexity of hyperspectral data, and the extracted key information helps to more accurately identify and quantify the characteristics of tobacco leaf samples. By associating the principal component distribution with the hyperspectral image, more abundant and intuitive spectral information is provided for tobacco leaf mold detection, which enhances the prediction ability and classification accuracy of the model.
[0052] In an optional example of this embodiment, the tobacco leaf mildew experiment includes: placing multiple tobacco leaf samples (re-baked tobacco leaves) in an environment with a temperature of (22±2)°C and a humidity of (60±5)% for 48 hours; placing the balanced multiple tobacco leaf samples (re-baked tobacco leaves) in a constant temperature and humidity chamber, and adjusting the temperature to 30°C and the humidity to 85% to allow the tobacco leaf mildew to develop for a period of 28 days, thereby simulating the tobacco leaf mildew process under natural conditions. And it is possible to systematically study the mildew characteristics at different stages. This tobacco leaf mildew experimental method can not only accelerate the study of the tobacco leaf mildew process, but also accurately capture the subtle changes in the mildew process under controlled conditions, significantly improving the accuracy and reliability of tobacco leaf mildew detection. The data obtained by this tobacco leaf mildew experimental method provides an important basis for establishing a tobacco leaf mildew classification model.
[0053] Furthermore, multiple tobacco leaf samples (re-cured tobacco leaves) are regularly collected for hyperspectral image acquisition and sample collection, in the following manner: on the 0th day, before being placed in a constant temperature and humidity chamber, the first acquisition is performed; on the 1st to 4th day, once a day at an interval of 24 hours; on the 5th to 10th day, twice a day at an interval of 12 hours; on the 11th to 25th day, three times a day at an interval of 8 hours; on the 15th to 28th day, twice a day at an interval of 12 hours. Through the planned and phased acquisition of hyperspectral images of multiple tobacco leaf samples (re-cured tobacco leaves), the entire spectral change process of tobacco leaves from healthy state to mildew can be fully recorded, and continuous and dynamic monitoring of tobacco leaf mildew process is realized, ensuring the integrity and continuity of the data. By acquiring hyperspectral images at different time points, the spectral feature changes in the process of tobacco leaf mildew can be accurately captured, providing rich data support for the establishment of an accurate mildew detection model.
[0054] Please refer to Figures 1 to 12 The specific implementation process of the present invention is now described in detail in conjunction with the embodiments:
[0055] Ten tobacco leaf samples (re-roasted tobacco leaves) collected in 2020-2022 were selected. The above tobacco leaf samples came from Yun 87 (5 pieces) produced in Fujian, Yueyan 98 (3 pieces) produced in Guangdong, and Jade Workshop (2 pieces) produced in Yunnan, and they were guaranteed to be of the same grade.
[0056] The ICH260 constant temperature and humidity chamber (Memmert, Germany) was used for sample mildew experiments. In addition, the GaiaField visible near-infrared hyperspectral imager (Shuangli Hepu) was used for data collection. Such selection and configuration can effectively control the diversity of tobacco leaf samples and ensure more reliable experimental results.
[0057] The redried tobacco leaf samples were placed in an environment with a temperature of (22±2)℃ and a humidity of (60±5)% for 48 hours. The balanced samples were placed in a constant temperature and humidity chamber, and the tobacco leaf mildew experiment was conducted under the conditions of adjusting the temperature and humidity to 30℃ and 85% respectively. The sampling was carried out in the following manner with a cycle of 28 days:
[0058] (1) On day 0, i.e., before being placed in a constant temperature and humidity chamber at 30° C. and 85% humidity, each of the tobacco leaf samples is sampled for the first time;
[0059] (2) From the 1st to the 4th day, sampling is performed once a day at intervals of 24 hours for each of the tobacco leaf samples;
[0060] (3) From the 5th to the 10th day, sampling of each tobacco leaf sample was performed twice a day at an interval of 12 hours;
[0061] (4) From the 11th to the 25th day, sampling of each tobacco leaf sample was performed three times a day at an interval of 8 hours;
[0062] (5) From the 15th to the 28th day, each tobacco leaf sample was sampled twice a day at an interval of 12 hours.
[0063] Through the above process, the sample states of the re-roasted tobacco leaves from never being moldy, to being close to being moldy, and then to being completely moldy can be fully collected.
[0064] like Fig.12 As shown, the hyperspectral image acquisition system includes five parts: an imaging lens, a visible near-infrared hyperspectral imager, a short-wave hyperspectral imager, a box and a computer. Among them, the hyperspectral camera 10 is installed at the top of the box 60, facing the electric stage 40. The halogen lamp 20 is installed at the top of the box 60 and arranged around the hyperspectral camera 10. The test sample 30 is placed in the center of the electric stage 40, which is located in the center of the box 60 and directly below the hyperspectral camera 10. The electric stage 40 is connected to the computer 50 through a motor and a transmission mechanism. The computer 50 controls the movement of the electric stage 40 as needed to achieve accurate positioning of the test sample 30. The computer 50 is installed on one side of the box 60, and is connected to the hyperspectral camera 10 and the electric stage 40 through a data cable and a power cable. The box 60 is a closed structure, and all components are installed inside it.
[0065] The redried tobacco leaf sample is placed on the electric stage 40, and the electric stage drives the tobacco leaf sample through the field of view of the hyperspectral camera 10 at a speed of 1.2 cm / s for linear scanning to complete the hyperspectral data acquisition of the entire tobacco leaf sample. The selected moving speed of the electric stage 40 should ensure that the horizontal and vertical axes have equal spatial resolution, avoid image size distortion, and be suitable for the set camera exposure time. The image acquisition process is controlled by the SpecView software equipped with the hyperspectral image acquisition system. In order to correct the original image I from the dark current of the hyperspectral camera 10 and improve the signal-to-noise ratio, under the same system parameters as the tobacco leaf sample image acquisition, first scan the standard white calibration plate with a reflectivity of 99% to obtain a fully white calibration image W; then obtain a fully black calibration image B through the built-in blackboard. Finally, the corrected image R is calculated according to formula (1).
[0066]
[0067] After data collection, the obtained hyperspectral image contains 250 dimensions of tobacco leaf and background spectral information. First, the spectral data of the region of interest (ROI) of the hyperspectral image is selected and preprocessed to reduce background information interference and data processing complexity.
[0068] The steps of selecting ROI are as follows: (1) Compare the spectral values of the pixels in the sample area and the background area, and find that the spectral values of the background and the sample in the 920nm band image are the most different. Select this band image as the mask data, and use the maximum inter-class variance method to perform binarization to construct the mask; (2) In the mask image, the sample area becomes 1, and the background area becomes 0. Use the constructed mask image to mask the original hyperspectral image, and only retain the sample area information. Figure 3 As shown in the figure, the reflectivity extraction process is shown, and the tobacco leaf ROI extraction process of the synthetic pseudo-color image with three wavelengths of 639nm, 551nm and 469nm is given, where a is the pseudo-color image, b is the 920nm grayscale image, and the red part of c is the selected ROI.
[0069] The spectral data of all pixels in the sample ROI are extracted as the component discrimination research data for pixels, and the average spectrum of pixels at all points in the area of interest is used as the component discrimination research data for the spectrum. The acquired spectral wavelength range is 350-1150nm. The stability of the spectral data in this area is analyzed. The data before 400nm and after 1100nm have large noise and are removed first. The data in the range of 400-1100nm are selected for subsequent analysis, and the acquired data has 250 spectral dimensions. Among them, hyperspectral data acquisition and correction are based on the Spec View software platform, and the selection of the area of interest, extraction of spectral data and subsequent data preprocessing, characteristic wavelength selection, and establishment of classification models are all based on Python3.7 software.
[0070] Since the collection of hyperspectral data is affected by factors such as instrument status, detection environment, and operating level, the standard normal transformation (SNV) is used to preprocess the spectrum of the ROI to reduce the impact of the external environment and improve the data signal-to-noise ratio. SNV can remove the noise caused by uneven distribution of the sample surface and particle scattering. Formula (2) is the mathematical calculation formula of SNV.
[0071]
[0072] The spectral data of all pixels in the ROI after preprocessing were extracted by random sampling, and the spectral reflectance values of 75,000 pixels in the ROI of normal samples and moldy samples were obtained as samples. The Kennard-stone method was used to divide the samples into training set and test set in a ratio of 3:1, and the number of samples in the training set and test set was 112,500 and 37,500, respectively.
[0073] Since hyperspectral images have hundreds of bands, high-dimensional data brings huge computing and storage burdens to computer hardware, which is not conducive to the efficient online operation of classification and detection tasks, and also limits the application scenarios in industry. On the other hand, due to the correlation between hyperspectral band images, there is a large amount of redundant information, and it is not necessary to use and store all bands. In order to reduce the impact of redundant information in hyperspectral images on data modeling, avoid the dimensionality disaster, and further improve the accuracy and timeliness of the model. Principal component analysis and continuous projection algorithm are used to extract characteristic wavelengths from the test set data.
[0074] Principal Component Analysis (PCA) is a commonly used data dimensionality reduction technique and is also widely used for band selection of spectral features. PCA can convert the original high-dimensional spectral data into a low-dimensional principal component space through linear transformation, thereby reducing the dimension of the data while retaining the most important information.
[0075] Successive projections algorithm (SPA) is an effective forward-cycle characteristic wavelength extraction method, which has been widely used in the field of spectral analysis. SPA can fully find the wavelength combination containing the minimum redundant information from the spectral information to represent the maximum information content of the sample.
[0076] Let the initial iteration vector be X k ( 0 ), the number of variables to be extracted is N, and the spectral matrix is J columns. Select one column (the jth column) of the spectral matrix and assign the jth column of the modeling set to X j , denoted by X k ( 0 ), and denote the set of unselected column vector positions as S.
[0077]
[0078] Calculate X separately j Projection onto the remaining column vectors:
[0079]
[0080] Extract the spectral wavelength of the maximum projection vector
[0081]
[0082] Let X j =P X ,j∈S,n=n+1, if n<N, then calculate repeatedly according to formula (2). Finally, the extracted variable is {X k(n) =0,…,N-1}. Through this process, the continuous projection algorithm can compress high-dimensional data into a low-dimensional space, thereby realizing data visualization and analysis.
[0083] Principal component analysis combines linearly related variables into new independent variables through orthogonal transformation, and can obtain the principal component score distribution of samples of different categories, and qualitatively judge the separability of samples of different categories. Table 1 lists the contribution rates of the first five principal components of the hyperspectral data of moldy tobacco leaves. The principal component analysis of the reflectance spectrum data of tobacco leaves and non-tobacco substances shows that the contribution rates of the first three principal components are 96.26%, 2.22%, and 1.18%, respectively, and the cumulative contribution rate exceeds 99%, indicating that the first three principal components can contain most of the original spectral information. The score distribution of the samples in the first three principal components is shown in the figure below. Figure 4 As shown, it can be seen that normal tobacco leaves and moldy ones are clustered together separately, which further shows that there is good separability between the two and they can be effectively identified using hyperspectral imaging technology.
[0084] Table 1
[0085]
[0086] The signal-to-noise ratio of the spectral data was evaluated. The signal-to-noise ratio of the data in the spectral range before 400nm and after 1100nm was low, so the data in the spectral range of 400-1100nm were selected for subsequent analysis, totaling 250 bands. Figure 5 As shown in Figure 1, the average spectral reflectance of the moldy tobacco leaves and normal tobacco leaves is obtained by taking the average value of the spectra of 50,000 pixels of each of the moldy tobacco leaves and the normal tobacco leaves. The average spectral curve of the moldy tobacco leaves and the normal tobacco leaves is shown in Figure 1. Figure 6 As shown, there is a more obvious difference in reflectivity between the two after the wavelength of 450nm, so the two can be distinguished based on this.
[0087] In the subsequent hyperspectral data analysis, the SNV preprocessing method is selected to preprocess the raw spectral data to reduce the impact of noise and improve the validity of the data. Figure 2 The classification model established using SNV preprocessing has the highest average classification accuracy in both the training set and the test set.
[0088] Table 2
[0089]
[0090]
[0091] 2.3 Characteristic wavelength selection
[0092] SPA is used to select characteristic wavelengths in the training set data. Figure 8 As shown in the figure, it is the load coefficient curve of principal component 1 (PC1) and principal component 2 (PC2), where the peaks and troughs indicate that the corresponding wavelengths account for the main contribution. Figure 7 As shown in the figure, 1080nm and 1800nm correspond to peaks or troughs in the two curves respectively, which shows that the above two bands can reflect the differences in spectral information of the six types of samples;
[0093] SPA is used to reduce the wavelength variable dimension of the spectral data after SNV preprocessing. The principle of selecting the characteristic wavelength combination is the wavelength variable combination corresponding to the lowest root mean square error (RMSE). Therefore, the wavelength corresponding to the selected 20 wavelength variables is the selected characteristic wavelength. Fig. 9 As shown, the results of wavelength algorithm selection based on the tobacco leaf spectral curve are displayed.
[0094] The SPA-RF algorithm is used as the optimal model. Fig.10As shown in Figure 2, the RF model established after variable screening by SPA ensures a good accuracy rate while greatly reducing the amount of model calculation. Fig.11 As shown in the figure, the visualization of the detection results of the SPA-RF model in the verification image data proves that the classification and identification of tobacco leaf mold based on the SPA-RF model is extremely feasible.
[0095] The detailed explanation of the above-mentioned embodiments is only intended to explain the present invention so as to facilitate a better understanding of the present invention. However, these descriptions cannot be interpreted as limitations on the present invention for any reason. In particular, the various features described in different embodiments may also be arbitrarily combined with each other to form other embodiments. Unless there is a clear description to the contrary, these features should be understood to be applicable to any embodiment and are not limited to the described embodiments.
Claims
1. A method for detecting tobacco leaf mildew based on hyperspectral, characterized in that: The tobacco leaf mildew detection method comprises: Obtaining hyperspectral images of tobacco leaf samples and constructing a tobacco leaf hyperspectral image database, wherein the tobacco leaf samples at least include normal tobacco leaves, tobacco leaves close to being moldy, and moldy tobacco leaves; Based on the tobacco leaf hyperspectral image database, a tobacco leaf mildew classification model is constructed; The tobacco leaf mildew classification model is used to classify and identify the mildew of the tobacco leaf to be tested.
2. The method for detecting tobacco leaf mildew based on hyperspectral according to claim 1, characterized in that: Based on the tobacco leaf hyperspectral image database, a tobacco leaf mildew classification model is constructed, including: Extracting hyperspectral data from the hyperspectral image and preprocessing the hyperspectral data; The pre-processed hyperspectral data is subjected to characteristic wavelength selection and the tobacco leaf mildew classification model is established.
3. The method for detecting tobacco leaf mildew based on hyperspectral according to claim 2, characterized in that: Extracting hyperspectral data from the hyperspectral image includes: The 920nm band image is selected as the mask data, and the maximum inter-class variance method is used to perform binarization to construct the mask image; Using the constructed mask image to mask the original hyperspectral image, and obtaining a hyperspectral image region of interest; The spectral data of all pixels in the region of interest of the hyperspectral image are extracted as component discrimination research data, and the data with a spectral wavelength range of 400 to 1100 nm in the component discrimination research data are selected as the hyperspectral data.
4. The method for detecting tobacco leaf mildew based on hyperspectral according to claim 2, characterized in that: The hyperspectral data were preprocessed using the SNV algorithm.
5. The method for detecting tobacco leaf mildew based on hyperspectral according to claim 2, characterized in that: The characteristic wavelength is selected for the pre-processed hyperspectral data by using the SPA algorithm.
6. The method for detecting tobacco leaf mildew based on hyperspectral according to claim 2, characterized in that: The random forest algorithm was used to establish the tobacco leaf mold classification model.
7. The method for detecting tobacco leaf mildew based on hyperspectral according to claim 1, characterized in that: Obtain hyperspectral images of tobacco leaf samples, including: A tobacco leaf mildew experiment is performed on a plurality of tobacco leaf samples. During the tobacco leaf mildew experiment, hyperspectral images of the plurality of tobacco leaf samples are collected regularly.
8. The method for detecting tobacco leaf mildew based on hyperspectral according to claim 7, characterized in that: Obtaining hyperspectral images of tobacco leaf samples, including: Performing cost analysis on the tobacco leaf samples and obtaining principal component distribution; The principal component distribution is associated with the hyperspectral image.
9. The method for detecting tobacco leaf mildew based on hyperspectral according to claim 7, characterized in that: The tobacco leaf mildew experiment includes: Place multiple tobacco leaf samples in an environment with a temperature of (22±2)°C and a humidity of (60±5)% for 48 hours; The balanced multiple tobacco leaf samples were placed in a constant temperature and humidity chamber, and the tobacco leaf mold was tested under the conditions of a temperature of 30° C. and a humidity of 85%, with a cycle of 28 days.
10. The method for detecting tobacco leaf mildew based on hyperspectral according to claim 9, characterized in that: The multiple tobacco leaf samples are regularly subjected to hyperspectral image acquisition and sample collection in the following manner: On day 0, before being placed in the constant temperature and humidity chamber, the first sample collection is performed on each of the tobacco leaf samples; On the 1st to 4th day, each tobacco leaf sample is sampled once a day at an interval of 24 hours; On the 5th to 10th day, the tobacco leaf samples were collected twice a day at an interval of 12 hours; From the 11th to the 25th day, the tobacco leaf samples were collected three times every day at an interval of 8 hours; From the 15th to the 28th day, samples of each tobacco leaf sample were collected twice every day at an interval of 12 hours.
Citation Information
Cited By
Mildew feature mining and data enhancement method for redried tobacco leaves
CN121861305A