Method for non-destructively detecting purity of hybrid corn based on near-infrared hyperspectral technology
Through near-infrared hyperspectral technology and quantum computing technology, combined with dynamic spectral enhancement and multiple scattering correction, the characteristic wavelengths that are sensitive to the purity of hybrid corn are screened out, solving the problems of low signal-to-noise ratio and inaccurate feature extraction in traditional spectral detection methods, and achieving high-precision detection of hybrid corn purity.
Patent Information
- Application Number
- CN202411731665.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-02-25
AI Technical Summary
Traditional spectral detection methods have low signal-to-noise ratio due to environmental factors, and inaccurate feature extraction, which affects detection accuracy.
Near-infrared hyperspectral technology is used to adjust the light source intensity through dynamic spectral enhancement technology, and spectral data are processed using multiple scattering correction method, and the characteristic wavelengths that are most sensitive to the purity of hybrid corn are screened using quantum computing technology and convolutional neural network model.
The clarity and signal-to-noise ratio of the spectral signal are improved, and the characteristic wavelengths that are sensitive to the purity of hybrid corn are accurately screened, which significantly improves the accuracy and reliability of the detection.
Smart Images

Figure CN119510346A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of purity detection, in particular to a method for nondestructively detecting the purity of hybrid corn based on near-infrared hyperspectral technology. Background Art
[0002] In recent years, with the continuous advancement of agricultural technology, the application of near-infrared hyperspectral technology (NIR-HSI) in crop quality detection has attracted widespread attention. This technology can detect detailed information on the chemical composition, physical properties and growth status of crops by capturing the reflection spectrum at different wavelengths.
[0003] Traditional detection methods often rely on chemical analysis or physical testing, which has problems such as sample destruction, time-consuming and high cost. In addition, the signal-to-noise ratio and clarity of spectral data are often affected by factors such as ambient lighting and sample surface conditions, resulting in reduced detection accuracy. In addition, traditional feature extraction methods rely more on manual experience and are difficult to effectively screen the wavelengths that are most sensitive to crop purity, which in turn affects the model's predictive ability. Summary of the invention
[0004] In view of the above existing problems, the present invention is proposed.
[0005] Therefore, the present invention provides a method for nondestructive detection of hybrid corn purity based on near-infrared hyperspectral technology to solve the problems of low signal-to-noise ratio and inaccurate feature extraction caused by environmental factors in traditional spectral detection methods.
[0006] In order to solve the above technical problems, the present invention provides the following technical solutions: In a first aspect, the present invention provides a method for nondestructively detecting the purity of hybrid corn based on near-infrared hyperspectral technology, which comprises: obtaining hybrid corn to be detected, using dynamic spectrum enhancement technology to adjust the intensity of the light source; After the light source intensity is adjusted, the hyperspectral imaging device begins to collect spectral data of hybrid corn; The spectral data were processed by multiple scattering correction method to obtain clear spectral data; Based on clear spectral data, the characteristic wavelength that is most sensitive to the purity of hybrid corn is screened; The purity of hybrid corn is identified using the screened characteristic wavelengths.
[0007] As a preferred solution of the method for nondestructive detection of hybrid corn purity based on near-infrared hyperspectral technology of the present invention, dynamic spectrum enhancement technology is used to adjust the intensity of the light source, including the following steps: Placing the hybrid corn to be detected on the sample stage of the hyperspectral imaging device, fixing the hybrid corn with a positioning fixture, starting the hyperspectral imaging device, detecting the reflectivity of the hybrid corn surface at different wavelengths, and setting the average value of the reflectivity at different wavelengths as the reflectivity threshold; According to the reflectivity, the adjusted light source intensity is calculated and expressed as: ;in, Indicates the adjusted light intensity. represents the initial light source intensity, represents the adjustment factor, Indicates the set reflectivity threshold, Represents reflectivity; When the reflectivity is less than the reflectivity threshold, the light intensity is increased according to the calculated adjusted light intensity value. When the reflectivity is greater than the reflectivity threshold, the light intensity is reduced according to the calculated adjusted light intensity value until the reflectivity of the hybrid corn surface is equal to the set reflectivity threshold.
[0008] As a preferred solution of the method for nondestructive detection of hybrid corn purity based on near-infrared hyperspectral technology of the present invention, after the light source intensity is adjusted, the hyperspectral imaging device starts to collect spectral data of the hybrid corn, including the following steps: Set exposure time, sampling frequency and wavelength range; The hyperspectral imaging device collects spectral data of hybrid corn samples according to the set parameters and real-time monitoring of reflectance. During the collection process, the reflection intensity, sample number, timestamp and wavelength at each wavelength are recorded.
[0009] As a preferred solution of the method for nondestructive detection of hybrid corn purity based on near-infrared hyperspectral technology of the present invention, the spectral data is processed by a multiple scattering correction method to obtain clear spectral data, including the following steps: The Kubelka-Munk model is selected as the tool of the multiple scattering correction method, and the scattering correction coefficient is calculated by the selected correction model; Using the calculated scattering correction coefficient, the spectral data is corrected to obtain the corrected reflectance; Output clear spectral data based on the corrected reflectance.
[0010] As a preferred solution of the method for nondestructive detection of hybrid corn purity based on near-infrared hyperspectral technology of the present invention, a characteristic wavelength set sensitive to the purity of hybrid corn is formed based on clear spectral data, including the following steps: Save the clean spectral data in a structured format and read the data using the pandas library in Python; For each hybrid corn, a vector containing the reflectance value at each wavelength is generated, and the reflectance vectors of all hybrid corns are combined to form a reflectance data matrix, in which each row is the reflectance vector of one sample; Using quantum state encoding method, the reflectivity vector of each sample is encoded into a quantum state; Use quantum support vector machine QSV to evaluate the importance of all wavelengths in parallel and output the importance score of each wavelength; Based on the importance scores, a set of characteristic wavelengths sensitive to the purity of hybrid corn was selected.
[0011] As a preferred solution of the method for nondestructive detection of hybrid corn purity based on near-infrared hyperspectral technology of the present invention, the characteristic wavelength most sensitive to the purity of hybrid corn is screened out based on the characteristic wavelength set, including the following steps: Add a purity label to each hybrid corn, the purity label indicates the purity value of each hybrid corn; The convolutional neural network model was selected as the architecture to process clean spectral data; The convolutional neural network model is trained using clear spectral data. After the training is completed, the weights of the convolutional layer are extracted from the convolutional neural network model. The wavelength corresponding to the convolution kernel is the characteristic wavelength that is more important for the convolutional neural network model to predict the purity of hybrid corn. For each characteristic wavelength in the characteristic wavelength set, the average weight in all convolution kernels is calculated, the wavelengths are sorted according to the average weight, and the characteristic wavelengths with larger weights at the top of the sort are selected as potential important characteristic wavelengths; The TensorBoard visualization tool was used to visualize the potentially important characteristic wavelengths, generate characteristic graphs, and observe the response intensity of specific wavelengths in the characteristic graphs. The specific wavelength with the highest response intensity was selected as the final characteristic wavelength that was most sensitive to the purity of hybrid corn.
[0012] As a preferred solution of the method for nondestructive detection of hybrid corn purity based on near-infrared hyperspectral technology of the present invention, the purity of hybrid corn is identified by using the screened characteristic wavelength, including the following steps: Extract clear spectral data from new hybrid corn, perform specific wavelength screening, and output the characteristic wavelength that is most sensitive to the purity of hybrid corn; Based on the characteristic wavelength of the output, the quantum random forest model is used to find the corresponding purity label, which is expressed as: ;in, Indicates characteristic wavelength Purity label, represents the characteristic wavelength, represents the number of trees in the random forest, Indicates Trees on characteristic wavelengths The search results, Represents the index of the tree; Based on the purity tags found, the purity of new hybrid corn is obtained; When the purity label is not identified, the characteristic wavelength that is most sensitive to the purity of hybrid corn is re-extracted, and the hybrid corn purity is monitored using the quantum random forest model until the purity of the hybrid corn is identified.
[0013] The beneficial effects of the present invention are as follows: the present invention uses dynamic spectral enhancement technology to adjust the intensity of the light source to optimize the quality of the spectral signal, uses the multiple scattering correction method to process the spectral data to eliminate interference factors, and uses quantum computing technology and convolutional neural network models to efficiently and accurately screen the characteristic wavelengths that are most sensitive to the purity of hybrid corn, and finally determines the most sensitive wavelength through the TensorBoard visualization tool, solving the problems of weak signal, large noise, and inaccurate feature selection in traditional spectral analysis. This solution not only greatly improves the accuracy and reliability of hybrid corn purity detection, but also simplifies the feature selection process, enhances the robustness and interpretability of the model, and provides strong technical support for agricultural production and quality monitoring. In addition, the quantum computing technology used in the solution is expected to further improve the speed and efficiency of data processing in the future, injecting new vitality into the development of modern agriculture. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0015] Figure 1 This is a flow chart of the method for nondestructive detection of hybrid corn purity based on near-infrared hyperspectral technology in Example 1.
[0016] Figure 2 This is an identification diagram for the purity of hybrid corn in Example 1. DETAILED DESCRIPTION
[0017] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the accompanying drawings.
[0018] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0019] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive with other embodiments.
[0020] Example 1, reference Figure 1 and Figure 2 , which is the first embodiment of the present invention, provides a method for nondestructive detection of hybrid corn purity based on near-infrared hyperspectral technology, comprising the following steps: S1: Obtain hybrid corn to be tested, use dynamic spectrum enhancement technology, and adjust the light source intensity, including the following steps: It should be noted that representative hybrid corn was selected to ensure that the samples covered different varieties and batches; Clean the surface of the hybrid corn to remove any impurities that may affect the spectral data, assign a unique identifier to each hybrid corn, and create a record form (number, variety, batch number and source information); Place the hybrid corn to be tested on the sample stage of the hyperspectral imaging device, ensure that the surface of the hybrid corn faces the light source, use a positioning fixture or a bracket to fix the hybrid corn, ensure that each hybrid corn is on the same horizontal plane, reduce the difference in spectral data caused by position changes, start the hyperspectral imaging device, ensure that all components work normally, including the light source, sensor and data processing unit, detect the reflectivity of the hybrid corn surface at different wavelengths, and set the average value of the reflectivity at different wavelengths as the reflectivity threshold; The reflectivity expression is, ;in, Reflectivity refers to the light reflection ability of the material surface at a specific wavelength. Indicates the intensity of reflected light. The intensity of light reflected from the sample surface directly affects the calculation result of reflectivity. The sensor is used to measure the intensity of light reflected from the sample surface. It represents the incident light intensity, the light intensity that hits the surface of the sample, and is measured using the light intensity emitted by the light source; According to the reflectivity, the adjusted light source intensity is calculated and expressed as: ;in, Indicates the adjusted light intensity. Indicates the initial light intensity, which serves as the basis for adjusting the light intensity. Indicates the adjustment coefficient, which is used to control the amplitude of the light source intensity adjustment. It is determined through experiments or experience to achieve the best adjustment effect. Indicates the set reflectivity threshold value, which is used as the target value for adjusting the light source intensity; When the reflectivity is less than the reflectivity threshold, the light source intensity is increased according to the calculated adjusted light source intensity value to improve the clarity and signal-to-noise ratio of the spectral signal. When the reflectivity is greater than the reflectivity threshold, the light source intensity is reduced according to the calculated adjusted light source intensity value to prevent overexposure until the reflectivity of the hybrid corn surface is equal to the set reflectivity threshold.
[0021] It should be noted that comprehensive sample collection was implemented by selecting representative hybrid corn to ensure that the samples covered different varieties and batches. The cleaning and labeling process in this step can effectively remove interfering factors that may affect the spectral data and create traceable records for each sample, thereby enhancing the reliability and repeatability of the data. The dynamic spectral enhancement technology was used to adjust the light source intensity, so as to achieve the purpose of collecting samples under optimal lighting conditions, thereby improving the clarity and signal-to-noise ratio of the spectral signal, laying the foundation for subsequent data collection.
[0022] S2: After the light source intensity is adjusted, the hyperspectral imaging device starts to collect spectral data of hybrid corn, including the following steps: It should be noted that the exposure time is set according to the ambient light conditions. It is usually recommended to set it to 100 milliseconds initially, which can be adjusted according to real-time feedback. The sampling frequency is set to 10 Hz, that is, data is collected 10 times per second to ensure that the dynamically changing reflectance characteristics are captured. The wavelength range is based on the spectral characteristics of hybrid corn, and a suitable wavelength range (e.g., 400nm to 2500nm) is selected to capture the visible light and near-infrared light parts; The hyperspectral imaging device collects spectral data of hybrid corn samples according to the set parameters and real-time monitoring of reflectance. During the collection process, the reflection intensity, sample number, timestamp and wavelength at each wavelength are recorded.
[0023] It should be noted that the reflection intensity represents the spectral reflection intensity value at each wavelength. The sample number is to ensure the traceability of the data and record the unique identifier of each sample. The timestamp is to accurately record the time of data collection for subsequent analysis. The wavelength is to record each wavelength value collected in detail to ensure the integrity of the data.
[0024] It should be noted that after the light source intensity is adjusted, the hyperspectral imaging device begins to collect spectral data of hybrid corn. By adjusting the exposure time and sampling frequency according to real-time feedback, the dynamic change of reflection characteristics is fully captured. Selecting a suitable wavelength range (such as 400nm to 2500nm) can effectively capture the characteristics of visible light and near-infrared light, and fully display the spectral information of hybrid corn. This step ensures the richness and accuracy of the data, and provides high-quality basic data for subsequent analysis.
[0025] S3: Processing the spectral data using a multiple scattering correction method to obtain clear spectral data, including the following steps: It should be noted that the spectral data is saved in a structured format (such as CSV or Excel); The data processing software MATLAB (Matrix Lab) was used to import the spectral data, identify and fill missing values, and apply filters to reduce noise; The Kubelka-Munk model is selected as a tool for multiple scattering correction method for reflectance spectrum data correction. The scattering correction coefficient is calculated by the selected correction model and used to adjust the spectrum data, which is expressed as: ;in, represents the scatter correction coefficient, Represents the absorption coefficient, which describes the material's ability to absorb light. The value indicates that the material has a strong ability to absorb light. It is determined by measuring the transmission spectrum or comparing it with a standard sample. It can be estimated using a mathematical model in combination with known physical and chemical properties. Represents the scattering coefficient, which describes the degree of scattering of light in the material. The value indicates that the light is scattered to a greater extent, which is obtained by measuring the reflection spectrum experiment, especially the reflection intensity when the incident angle changes, and fitting the experimental data with the theoretical model; It should be noted that when light passes through an inhomogeneous medium (such as plant tissue), scattering and absorption occur. These two phenomena together determine the attenuation of light in the material. The scattering coefficient defined in the formula is Indicates the degree to which light is scattered, while the absorption coefficient It indicates the degree to which light is absorbed in the medium. It reflects the attenuation of light intensity caused by absorption and scattering in the process of light propagation. It can correct the scattered components in the reflection spectrum, thereby improving the accuracy of the reflectivity and making it closer to the real material properties.
[0026] The spectral data is corrected using the calculated scattering correction coefficient to obtain the corrected reflectance, which is expressed as: ;in, represents the corrected reflectance; It should be noted that by Divide by the scatter correction factor , realizing the correction of spectral data. This process effectively eliminates the error caused by scattering, making the data more accurate. The corrected reflectivity can reflect the true spectral characteristics of the material, and then provide reliable spectral data for subsequent analysis, such as purity detection.
[0027] Output clear spectral data based on the corrected reflectance.
[0028] It should be noted that by using the multiple scattering correction method to process the spectral data, confirming that the spectral data is saved in a structured format, and using MATLAB for data cleaning and noise reduction, this process achieves effective denoising and correction of the spectral data. The Kubelka-Munk model is used to calculate the scattering correction coefficient to ensure the true reflection of the reflectance, thereby significantly improving the accuracy of the data. The clear spectral data finally generated provides strong support for subsequent feature extraction, ensuring the scientificity and reliability of the analysis results.
[0029] S4: Based on the clear spectral data, screening the characteristic wavelength that is most sensitive to the purity of hybrid corn includes the following steps: Save the clean spectral data in a structured format such as CSV or Excel and read the data using the pandas library in Python; For each hybrid corn, a vector containing the reflectance value at each wavelength is generated, and the reflectance vectors of all hybrid corns are combined to form a reflectance data matrix, in which each row is the reflectance vector of one sample; Using quantum state encoding method, the reflectivity vector of each sample is encoded into a quantum state; Use quantum support vector machine QSV to evaluate the importance of all wavelengths in parallel and output the importance score of each wavelength; Based on the importance scores, a set of characteristic wavelengths sensitive to the purity of hybrid corn was selected.
[0030] It should be noted that the quantum state coding method significantly improves computing efficiency and data processing capabilities by converting classical data (such as the reflectivity vector of hybrid corn) into quantum states, and utilizes the parallel processing capabilities and quantum superposition and entanglement characteristics of quantum computers, and can evaluate the importance of all wavelengths in parallel in a short time. This method not only optimizes feature selection and more accurately identifies the characteristic wavelength set that is sensitive to the purity of hybrid corn, but also improves the robustness of data processing and reduces the impact of noise through quantum error correction technology. In addition, quantum state coding promotes the development of new data analysis methods, realizes efficient storage and transmission of data, and reduces the cost and time of processing large-scale data sets.
[0031] Add a purity label to each hybrid corn, the purity label indicates the purity value of each hybrid corn; The convolutional neural network model was selected as the architecture to process clean spectral data; The convolutional neural network model is trained using clear spectral data. After the training is completed, the weights of the convolutional layer are extracted from the convolutional neural network model. The wavelength corresponding to the convolution kernel is the characteristic wavelength that is more important for the convolutional neural network model to predict the purity of hybrid corn. For each characteristic wavelength in the characteristic wavelength set, the average weight in all convolution kernels is calculated, the wavelengths are sorted according to the average weight, and the characteristic wavelengths with larger weights at the top of the sort are selected as potential important characteristic wavelengths; It should be noted that by calculating the average weight of the characteristic wavelength in all convolution kernels and sorting and selecting them, this method can quantify the importance of features, improve the accuracy of feature selection, simplify the complexity of the model, enhance the robustness of the model, improve the detection accuracy, and accelerate model training, thereby significantly improving the efficiency and reliability of hybrid corn purity detection.
[0032] The TensorBoard visualization tool was used to visualize the potentially important characteristic wavelengths, generate characteristic graphs, and observe the response intensity of specific wavelengths in the characteristic graphs. The specific wavelength with the highest response intensity was selected as the final characteristic wavelength that was most sensitive to the purity of hybrid corn.
[0033] It should be noted that the TensorBoard visualization tool is used to visualize the potential important characteristic wavelengths and generate a characteristic graph. By observing the response intensity of a specific wavelength in the characteristic graph, the wavelength with the highest response intensity is determined as the final characteristic wavelength that is most sensitive to the purity of hybrid corn. This process not only intuitively demonstrates the importance of each wavelength, but also can accurately locate the most discriminating wavelength, thereby significantly improving the accuracy and reliability of hybrid corn purity detection. At the same time, it simplifies the feature selection process, making the model more efficient and easy to interpret, and ultimately improving the overall performance and practicality of the detection system.
[0034] S5: Using the selected characteristic wavelengths to identify the purity of hybrid corn, including the following steps: Extract clear spectral data from new hybrid corn, perform specific wavelength screening, and output the characteristic wavelength that is most sensitive to the purity of hybrid corn; Based on the characteristic wavelength of the output, the quantum random forest model is used to find the corresponding purity label, which is expressed as: ;in, Indicates characteristic wavelength Purity label, represents the characteristic wavelength, represents the number of trees in the random forest, Indicates Trees on characteristic wavelengths The search results, Represents the index of the tree; It should be noted that the random forest model is used to analyze the output characteristic wavelengths and find the corresponding purity labels. The formula is used to determine each characteristic wavelength The purity label of hybrid corn has significant beneficial effects because this method makes full use of the ensemble learning ability of random forests, reducing the errors that may be caused by a single model by combining the prediction results of multiple decision trees, thereby improving the accuracy and stability of the prediction; in addition, random forests have excellent noise resistance and can maintain high prediction performance in data with noise and outliers, and it can also automatically evaluate the importance of characteristic wavelengths, helping to identify the spectral features that have the greatest impact on the purity of hybrid corn, thereby optimizing the feature selection process.
[0035] Based on the purity tags found, the purity of new hybrid corn is obtained; When the purity label is not identified, the characteristic wavelength that is most sensitive to the purity of hybrid corn is re-extracted, and the hybrid corn purity is monitored using the quantum random forest model until the purity of the hybrid corn is identified.
[0036] It should be noted that by using the selected characteristic wavelengths, the new hybrid corn clear spectral data is input into the trained convolutional neural network model to output the characteristic wavelength that is most sensitive to the purity of hybrid corn. This process combines the random forest model to find the corresponding purity label, and realizes the accurate identification of the purity of hybrid corn. The beneficial effect of this step is that it not only improves the accuracy and reliability of purity detection, but also provides an intelligent detection solution for agricultural production, which can quickly respond to changes in market demand, thereby improving the market competitiveness of hybrid corn.
[0037] This embodiment also provides a computer device, including: a memory and a processor; the memory is used to store computer executable instructions, and the processor is used to execute computer executable instructions to implement the method for non-destructive detection of hybrid corn purity based on near-infrared hyperspectral technology as proposed in the above embodiment.
[0038] The computer device may be a terminal, and the computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device may be a touch layer covered on the display screen, or a key, trackball or touchpad provided on the housing of the computer device, or an external keyboard, touchpad or mouse, etc.
[0039] This embodiment also provides a storage medium on which a computer program is stored. When the program is executed by a processor, the method for non-destructive detection of hybrid corn purity based on near-infrared hyperspectral technology proposed in the above embodiment is implemented; the storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (Static Random Access Memory, referred to as SRAM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, referred to as EEPROM), erasable programmable read-only memory (Erasable Programmable Read Only Memory, referred to as EPROM), programmable read-only memory (Programmable Red-Only Memory, referred to as PROM), read-only memory (Read-Only Memory, referred to as ROM), magnetic storage, flash memory, magnetic disk or optical disk.
[0040] In summary, the present invention uses dynamic spectrum enhancement technology to adjust the intensity of the light source to optimize the quality of the spectral signal, multiple scattering correction method to process the spectral data to eliminate interference factors, and uses quantum computing technology and convolutional neural network models to efficiently and accurately screen the characteristic wavelengths that are most sensitive to the purity of hybrid corn, and finally determines the most sensitive wavelength through the TensorBoard visualization tool, solving the problems of weak signal, large noise, and inaccurate feature selection in traditional spectral analysis. This solution not only greatly improves the accuracy and reliability of hybrid corn purity detection, but also simplifies the feature selection process, enhances the robustness and interpretability of the model, and provides strong technical support for agricultural production and quality monitoring. In addition, the quantum computing technology used in the scheme is expected to further improve the speed and efficiency of data processing in the future, injecting new vitality into the development of modern agriculture.
[0041] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.
Claims
1. A method for nondestructive detection of hybrid corn purity based on near-infrared hyperspectral technology, characterized in that: include: Obtain the hybrid corn to be tested, and use dynamic spectrum enhancement technology to adjust the light source intensity; After the light source intensity is adjusted, the hyperspectral imaging device begins to collect spectral data of hybrid corn; The spectral data were processed by multiple scattering correction method to obtain clear spectral data; Based on clear spectral data, the characteristic wavelength that is most sensitive to the purity of hybrid corn is screened; The purity of hybrid corn is identified using the screened characteristic wavelengths.
2. The method for nondestructive detection of hybrid corn purity based on near-infrared hyperspectral technology according to claim 1, characterized in that: Dynamic spectrum enhancement technology is used to adjust the light source intensity, including the following steps: The hybrid corn to be detected is placed on the sample stage of the hyperspectral imaging device, the hybrid corn is fixed with a positioning fixture, the hyperspectral imaging device is started, the reflectivity of the surface of the hybrid corn at different wavelengths is detected, and the average value of the reflectivity at different wavelengths is set as the reflectivity threshold; According to the reflectivity, the adjusted light source intensity is calculated and expressed as: ;in, Indicates the adjusted light intensity. represents the initial light source intensity, represents the adjustment factor, Indicates the set reflectivity threshold, Represents reflectivity; When the reflectivity is less than the reflectivity threshold, the light intensity is increased according to the calculated adjusted light intensity value. When the reflectivity is greater than the reflectivity threshold, the light intensity is reduced according to the calculated adjusted light intensity value until the reflectivity of the hybrid corn surface is equal to the set reflectivity threshold.
3. The method for nondestructive detection of hybrid corn purity based on near-infrared hyperspectral technology as claimed in claim 2, characterized in that: After the light source intensity is adjusted, the hyperspectral imaging device begins to collect spectral data of hybrid corn, including the following steps: Set exposure time, sampling frequency and wavelength range; The hyperspectral imaging device collects spectral data of hybrid corn samples according to the set parameters and real-time monitoring of reflectance. During the collection process, the reflection intensity, sample number, timestamp and wavelength at each wavelength are recorded.
4. The method for nondestructive detection of hybrid corn purity based on near-infrared hyperspectral technology as claimed in claim 3, characterized in that: The spectral data is processed by using the multiple scattering correction method to obtain clear spectral data, including the following steps: The Kubelka-Munk model is selected as the tool of the multiple scattering correction method, and the scattering correction coefficient is calculated by the selected correction model; Using the calculated scattering correction coefficient, the spectral data is corrected to obtain the corrected reflectance; Output clear spectral data based on the corrected reflectance.
5. The method for nondestructive detection of hybrid corn purity based on near-infrared hyperspectral technology as claimed in claim 4, characterized in that: Based on the clear spectral data, a characteristic wavelength set sensitive to the purity of hybrid corn is formed, including the following steps: Save the clean spectral data in a structured format and read the data using the pandas library in Python; For each hybrid corn, a vector containing the reflectance value at each wavelength is generated, and the reflectance vectors of all hybrid corns are combined to form a reflectance data matrix, in which each row is the reflectance vector of one sample; Using quantum state encoding method, the reflectivity vector of each sample is encoded into a quantum state; Use quantum support vector machine QSV to evaluate the importance of all wavelengths in parallel and output the importance score of each wavelength; Based on the importance scores, a set of characteristic wavelengths sensitive to the purity of hybrid corn was selected.
6. The method for nondestructive detection of hybrid corn purity based on near-infrared hyperspectral technology as claimed in claim 5, characterized in that: Based on the characteristic wavelength set, the characteristic wavelength most sensitive to the purity of hybrid corn is screened out, including the following steps: Add a purity label to each hybrid corn, the purity label indicates the purity value of each hybrid corn; The convolutional neural network model was selected as the architecture to process clean spectral data; The convolutional neural network model is trained using clear spectral data. After the training is completed, the weights of the convolutional layer are extracted from the convolutional neural network model. The wavelength corresponding to the convolution kernel is the characteristic wavelength that is more important for the convolutional neural network model to predict the purity of hybrid corn. For each characteristic wavelength in the characteristic wavelength set, the average weight in all convolution kernels is calculated, the wavelengths are sorted according to the average weight, and the characteristic wavelengths with larger weights at the top of the sort are selected as potential important characteristic wavelengths; The TensorBoard visualization tool was used to visualize the potentially important characteristic wavelengths, generate characteristic graphs, and observe the response intensity of specific wavelengths in the characteristic graphs. The specific wavelength with the highest response intensity was selected as the final characteristic wavelength that was most sensitive to the purity of hybrid corn.
7. The method for nondestructive detection of hybrid corn purity based on near-infrared hyperspectral technology as claimed in claim 6, characterized in that: Using the selected characteristic wavelengths to identify the purity of hybrid corn includes the following steps: Extract clear spectral data from new hybrid corn, perform specific wavelength screening, and output the characteristic wavelength that is most sensitive to the purity of hybrid corn; Based on the characteristic wavelength of the output, the quantum random forest model is used to find the corresponding purity label, which is expressed as: ;in, Indicates characteristic wavelength Purity label, represents the characteristic wavelength, represents the number of trees in the random forest, Indicates Trees on characteristic wavelengths The search results, Represents the index of the tree; Based on the purity tags found, the purity of new hybrid corn is obtained; When the purity label is not identified, the characteristic wavelength that is most sensitive to the purity of hybrid corn is re-extracted, and the hybrid corn purity is monitored using the quantum random forest model until the purity of the hybrid corn is identified.