Grain quality detection device based on near infrared spectrum analysis and detection method thereof
By adopting the combination technology of multivariate scattering correction, principal component analysis and partial least squares algorithm in the infrared spectroscopy grain quality detection device, the problems of single measurement parameters, complex equipment, and difficult operation in the existing technology are solved, and high precision is achieved , Multi-parameter grain quality testing improves detection efficiency and stability.
Patent Information
- Application Number
- CN202411701146.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-26
- Publication Date
- 2025-02-14
AI Technical Summary
The existing infrared spectroscopy grain quality detection devices have single measurement parameters, complex equipment structure, high operating requirements, cumbersome data modeling process, complex signal operations, and susceptible to environmental factors, resulting in unstable measurement results.
The multivariate scattering correction algorithm (MSC) is used for pre-processing, principal component analysis (PCA) extracts characteristic wavelengths, partial least squares algorithm (PLS) is used to establish an inversion model, and combined with the designed movable spectral acquisition device and signal processing circuit, the near-term Real-time analysis of infrared spectral data enables accurate measurement of multi-parameters of moisture, protein and fat.
It realizes providing high-precision measurement results in a short time, is suitable for continuous monitoring of grain purchase and processing sites, improves the efficiency of grain quality control, and reduces system complexity and operation difficulty.
Smart Images

Figure CN119438129A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of spectrum measurement application, and in particular relates to a grain quality detection device based on near-infrared spectrum analysis and a detection method thereof. Background Art
[0002] Quality inspection during grain storage, transportation and processing is crucial, mainly involving improving product quality, extending shelf life and improving economic benefits. Quality parameters such as moisture, protein, and fat each play an important role. When the moisture content is appropriate, it can maintain freshness. Too high moisture content can easily lead to mold, and too low moisture content can affect the taste. Protein is the main nutrient. Too high moisture content may make the dough too tough and increase the burden on the digestive system, while too low moisture content can reduce the nutritional value. Fat is the main source of energy. Too high moisture content may lead to high calories, while too low moisture content can affect the flavor of food.
[0003] At present, among the standard methods for grain quality testing, moisture testing generally adopts the drying and weighing method, which requires high sampling accuracy and is time-consuming. Protein testing usually uses the Kjeldahl method, which is widely applicable but cumbersome. Current fat testing methods include Soxhlet extraction and gas chromatography, but the operation is complicated and requires highly specialized technicians.
[0004] The basic measurement principle of near-infrared spectroscopy (NIRS) is based on the interaction between photons and material molecules, especially the energy level transition of photons. When infrared light is irradiated to the sample, photons of specific wavelengths are absorbed by the chemical bonds in the molecules, resulting in energy level transitions such as molecular vibration and rotation. Different chemical bonds (such as CH, OH, NH, etc.) have unique absorption characteristics at specific wavelengths. Therefore, by analyzing the absorption spectrum, the components in the sample can be identified and quantified.
[0005] In grain quality testing, the characteristic absorption peaks of parameters such as moisture, protein, and fat are all within specific bands. The OH stretching vibration of water is usually around 1440-1470nm, the NH and C=O vibrations of protein are about 1660-1750nm, and the characteristic absorption peaks of fat are generally about 700-1100nm. By establishing a quantitative model related to these characteristic absorption peaks, infrared spectroscopy can achieve rapid and non-destructive multi-parameter quality testing of grains. Therefore, in theory, infrared spectroscopy can efficiently measure important parameters such as moisture, protein, and fat in grains, providing reliable data support for food quality control.
[0006] There are several problems with current infrared spectroscopy measurement devices, including single measurement parameters, complex equipment structure, high operating requirements, cumbersome data modeling process, complex signal calculation, and infrared spectrum is easily affected by environmental factors, resulting in unstable measurement results. Therefore, this device aims to provide an infrared spectroscopy grain quality detection device and method with simple structure, convenient measurement, high stability and support for multi-parameter measurement. Summary of the invention
[0007] In view of the defects existing in the prior art, in order to improve the stability and measurement accuracy of the grain quality detection device of near infrared spectroscopy analysis, the present invention provides a grain quality detection device based on near infrared spectroscopy analysis and a detection method thereof; a multivariate scatter correction algorithm (MSC) is used for preprocessing, a principal component analysis (PCA) is used to extract characteristic wavelengths, and a partial least squares algorithm (PLS) is used to establish an inversion model, and a mobile spectral acquisition device and a signal processing circuit are designed to perform real-time analysis on near infrared spectral data, thereby accurately measuring the moisture, protein and fat of the sample being tested. The device can provide high-precision measurement results in a short time, is suitable for continuous monitoring of grain procurement and processing sites, and improves the efficiency of grain quality control.
[0008] The present invention is achieved through the following technical solutions:
[0009] A grain quality detection device based on near-infrared spectroscopy analysis comprises an operation window 1, a sample box 2, a bracket 3, a guide rail 4, a motor 5, an optical fiber probe 6, a fixing frame 7, a light source unit 8, a spectrum detection unit 9, a control unit 10, a host computer unit 11, a shell 12, and a sample to be tested 13; wherein the operation window 1 is a fixed opening on the upper part of the shell 12, located on one side of the top of the shell 12, and the sample box 2 is taken and placed through the operation window 1 during measurement; the sample box 2 is used to contain the sample and is placed on the bracket 3; the bracket 3 is fixed on a sliding platform of the guide rail 4, and the guide rail 4 is fixed on one side of the inner wall of the container shell to play a role of movement and support; the motor 5 is located on one side of the guide rail 4, and is used to drive the guide rail 4 to realize the horizontal movement of the bracket 3; the optical fiber probe 6 is fixed in the measurement area, and is located below the sample box, and is used to send out a spectrum signal and simultaneously measure the reflection spectrum. The optical fiber probe 6 and the optical fiber transmitting and receiving optical fiber line are fixedly clamped at one end of the fixing frame 7; one end of the light source unit 8 is connected to the control unit 10, and the other end is connected to the transmitting optical fiber line, and the control unit 10 controls the light source unit 8 to send the spectrum signal to the optical fiber probe 6; one end of the spectrum detection unit 9 is connected to the control unit 10, and the other end is connected to the receiving optical fiber line, and the spectrum detection unit 9 receives the near-infrared light reflection signal collected by the optical fiber probe, and after photoelectric conversion processing, generates corresponding spectrum data and transmits it back to the control unit 10; the control unit 10 is connected to the motor 5 and the host computer unit 11, and is used to receive the host computer command, control the spectrum transmission and reception of the light source unit 8 and the spectrum detection unit 9, and control the rotation of the motor 5; the host computer unit 11 reads the spectrum data, performs calculation processing, and obtains the measurement result.
[0010] Furthermore, the material of the sample box 2 is high-purity fused quartz with high light transmittance;
[0011] The main material of the bracket 3 is metal; the size matches the outer diameter of the sample box, the base is level to ensure the stability of spectrum collection during the measurement process, and the middle opening is light-transmissive and does not affect the passage of measurement light.
[0012] Furthermore, the sample 13 to be measured is grain, which is ground into powder and placed inside the sample box 2 and compacted during the measurement process.
[0013] Furthermore, the optical fiber probe 6 is located below the sample box 2, and the center of the probe is a multi-core optical fiber, including a transmitting optical fiber bundle and a receiving optical fiber bundle.
[0014] Furthermore, the fixing frame 7 adopts a clamping structure and is fixed with bolts to fix the optical fiber probe on the bracket.
[0015] Furthermore, the motor 5 has a limiting function, and can adjust the moving speed and position according to a preset program, and accurately control the movement of the sample holder in the measurement area and the operation area.
[0016] Further, the spectrum wavelength range emitted by the light source unit 8 is not less than 800nm to 2500nm, and the output power range is 1-10MW;
[0017] The effective range of the spectrum detection unit 9 is not less than 900nm to 1700nm.
[0018] Furthermore, the control unit 10 shown is developed using a 32-bit single-chip microcomputer or an embedded system, and uses a USB serial port for data communication.
[0019] On the other hand, the present invention also provides a detection method of a grain quality detection device based on near infrared spectroscopy analysis, and the specific steps are as follows:
[0020] Step 1, initial reset;
[0021] The control unit 10 completes initialization, resets the light source unit 8 and the spectrum detection unit 9, and controls the motor 5 to rotate the guide rail 4 to reset the bracket 3 to below the operation window 1;
[0022] Step 2: No-load detection;
[0023] The empty sample box 2 is placed on the bracket 3, and the motor 5 drives the guide rail 4 to move the bracket 3 to the measurement area and position it above the optical fiber probe 6. The control unit 10 starts the measurement program, controls the spectrum detection unit 9 to collect the no-load spectrum data, and uploads it to the host computer unit 11;
[0024] Step 3, intermediate reset;
[0025] Repeat step 1, the system performs a reset operation, and resets the bracket to the measurement window;
[0026] Step 4: Full load test;
[0027] The sample food to be tested is filled into the sample box, and the sample box is placed on the bracket; the motor 5 controls the guide rail 4 to move the sample box 2 to the spectrum measurement area; in the measurement area, the control unit 10 starts the measurement program, controls the spectrum detection unit 9 to collect the full-load spectrum data, and uploads it to the host computer unit 11;
[0028] Step 5: parameter prediction;
[0029] The upper computer unit 11 calls the parameter conversion algorithm to calculate and output relevant quality parameters, including: predicted values of moisture content, protein content and fat content.
[0030] Furthermore, in step 5, the parameter conversion algorithm specifically includes the following steps:
[0031] S51, using the multivariate scatter correction algorithm (MSC) for spectral preprocessing, removing outliers in the data and correcting the spectral differences between samples;
[0032] S52, extracting characteristic wavelengths using a principal component analysis algorithm (PCA), preparing data and constructing a matrix, calculating a covariance matrix, performing eigenvalue decomposition, selecting principal components that explain high variance, and finally projecting the original data onto the principal components;
[0033] S53. The partial least squares algorithm (PLS) is used to predict the moisture content, protein and fat content of soybeans based on the characteristic wavelength as input features.
[0034] Compared with the prior art, the advantages of the present invention are as follows:
[0035] (1) A grain quality detection device and detection method based on near-infrared spectroscopy analysis of the present invention adopts a single-probe multi-core transceiver optical fiber and a quartz sample container to ensure efficient light transmission, improve the accuracy of spectral acquisition, and reduce the complexity of the system;
[0036] (2) The spectral measurement area is set in the dark area inside the device, and the motor drives the sample to move accurately between the operation area and the spectral collection area for measurement, effectively reducing the interference of external ambient light on the spectral measurement;
[0037] (3) Spectral data is preprocessed based on multivariate scattering correction, characteristic wavelength extraction based on principal component analysis, and an inversion model is established using the partial least squares algorithm to achieve simultaneous and accurate measurement of multiple parameters of grain quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following is a brief introduction to the drawings required for the specific embodiments or the description of the prior art. In all the drawings, similar elements or parts are generally identified by similar reference numerals. In the drawings, the elements or parts are not necessarily drawn according to the actual scale.
[0039] Figure 1 It is a structural schematic diagram of a grain quality detection device based on near infrared spectroscopy analysis of the present invention;
[0040] Figure 2 A top view of a food quality detection device based on near-infrared spectroscopy analysis invented;
[0041] Figure 3 This is a schematic diagram of a fiber optic probe for grain quality detection based on near infrared spectroscopy analysis of the present invention;
[0042] Among them, (a) is a top view of the optical fiber probe, and (b) is a side view of the optical fiber probe;
[0043] Figure 4 This is a spectrum data processing diagram for grain quality detection based on near infrared spectrum analysis of the present invention;
[0044] Among them, (a) is the original spectrum, (b) is the MSC pre-processed spectrum;
[0045] Figure 5 A comparison chart of the actual value and predicted value of grain quality detection based on near infrared spectroscopy analysis proposed by the present invention;
[0046] Among them, (a) is a comparison chart of actual moisture content and predicted content, (b) is a comparison chart of actual protein content and predicted content, and (c) is a comparison chart of actual fat content and predicted content. DETAILED DESCRIPTION
[0047] In order to clearly and completely describe the technical solution and its specific working process of the present invention, the specific implementation methods of the present invention are as follows in conjunction with the accompanying drawings of the specification:
[0048] Example 1
[0049] like Figure 1As shown, this embodiment provides a food quality detection device based on near-infrared spectroscopy analysis, including an operation window 1, a sample box 2, a bracket 3, a guide rail 4, a motor 5, an optical fiber probe 6, a fixing frame 7, a light source unit 8, a spectrum detection unit 9, a control unit 10, a host computer unit 11 and a housing 12; wherein, the operation window 1 is a fixed opening on the upper part of the device housing 12, which is convenient for the user to place the sample box 2 on the bracket 3 through the window. The size of the window is 120mm×120mm. The sample box 2 is used to hold food samples, and the bottom outer diameter is 100mm. The circular container is made of high-purity fused quartz and has a thickness of 3mm. The housing 12 is made of high-strength aluminum alloy material and has a size of 500mm×300mm×300mm. The bracket 3 is fixed on the guide rail 4 through a sliding platform and can move accurately in the horizontal direction. The guide rail 4 adopts a linear screw slide design with a length of 250mm, an internal screw diameter of 16mm, a moving distance of 200mm, and is made of aluminum alloy material. The bracket 3 is made of metal and is fixed on the slide of the guide rail 4, with a maximum load-bearing capacity of 3kg. The guide rail 4 is fixed on one side of the housing 12 to play a role in movement and support. The motor 5 is used to drive the bracket 3 on the guide rail 4 to move horizontally. The motor model is "stepping motor 57BYG250-01", with a rated power of 30W, a rated speed of 1500rpm, and a maximum torque of 0.35Nm. The optical fiber probe 6 is located below the sample box 2 and is used to transmit near-infrared spectral signals and receive reflected signals. The internal diameter of the optical fiber probe is 10mm, and the outer side of the multi-core optical fiber is protected by a stainless steel wall with a diameter of 12mm. The probe is 10mm away from the bottom of the sample box and is fixed in the measurement area with an adjustable bracket to ensure a constant distance from the surface of the sample box. The light source unit 8 is responsible for providing spectral signals, which are provided by the "Ocean Optics HL-2000" xenon light source. The emission wavelength range of the light source is 300nm to 2500nm, which is suitable for near-infrared spectroscopy analysis, with stable light output and long service life. The light source adjusts its output intensity through the control unit 10 to ensure the accuracy of the spectrum and the repeatability of the measurement. The spectrum detection unit 9 adopts the "Horiba Scientific-FT-IR" spectrometer, and the wavelength range covers from 900nm to 1700nm. The control unit 10 adopts the STM32F4 series single-chip microcomputer (model STM32F407ZG), which has high-performance processing capabilities, a main frequency of 168MHz, a memory of 512KB, and can quickly respond to host computer instructions. The control unit 10 communicates with the host computer unit 11 through the serial port, receives and sends control commands, controls the drive of the motor 5, adjusts the light intensity output of the light source unit, and obtains the data of the spectrum detection unit 9. The host computer unit 11 is used to receive the spectrum data transmitted by the control unit 10 and perform data processing.The host computer uses a high-performance desktop computer with an i7 processor, 16GB memory, 256GB SSD hard drive, and Windows 10 operating system. Through the software interface of the host computer, users can monitor the detection process in real time, set detection parameters, and read and analyze the detection results.
[0050] Example 2
[0051] like Figure 3 As shown in FIG. 1 , a detailed diagram of a light probe of a grain quality detection device based on near-infrared spectroscopy analysis, the optical fiber probe 6 is a multi-core optical fiber, including a transmitting light beam and a receiving optical fiber beam; Figure 3 The top view shown in a of FIG. 1 shows that the outer circle of the optical fiber probe is the transmitting optical fiber bundle, and the inner circle is the receiving optical fiber bundle, which transmits and receives spectral signals, such as Figure 3 As shown in the side view shown in b, the two lower optical fiber bundles are connected to the light source unit 8 and the spectrum detection unit 9 respectively.
[0052] The launch fiber bundle is made of high-purity quartz glass and coated with an abrasion-resistant polymer coating.
[0053] The receive fiber bundle receives the spectral signal and is also made of quartz glass and has the same polymer coating to protect the fiber from external damage.
[0054] The fiber optic probe is designed with 25 cores, of which 16 cores are transmitting cores and 9 cores are receiving cores for near-infrared spectrum detection; the fiber optic probe has a diameter of 10mm, and the outer wall of the multi-core optical fiber is protected by a stainless steel wall with a diameter of 12mm, which can efficiently transmit near-infrared spectrum signals.
[0055] Example 3
[0056] The soybean sample is taken as an example to illustrate the modeling and measurement process of the device.
[0057] A detection method of a grain quality detection device based on near infrared spectroscopy analysis specifically comprises the following steps:
[0058] Step 1: Prepare samples. Select soybean samples and prepare four samples with different moisture content, protein content, and fat content. The moisture content is 9.8%, 13.8%, 17.8%, and 21.8%, respectively. The protein content of the four soybeans was measured, and the soybean content was 37.2%, 38.1%, 38.5%, and 39.9%, respectively. The fat content of the four soybeans was measured, and the soybean fat content was 20.1%, 21.6%, 23.3%, and 25.9%, respectively.
[0059] Step 2: Collect sample data. Collect spectral data of soybean samples with different moisture content, protein content and fat content. Perform difference calculation between sample spectral data and unloaded spectral data to obtain original spectral data. The original spectrum is as follows: Figure 4 As shown in (a).
[0060] Step 3: Preprocessing: MSC (Multiple Scattering Correction) is used to process the original soybean spectral data to remove outliers and correct the spectral differences between samples. The correction results are shown in Figure 3. Figure 4 as shown in (b).
[0061] Step 4: Extract characteristic wavelengths. Use PCA (principal component analysis) to extract characteristic wavelengths, prepare data and construct matrices, calculate covariance matrices, perform eigenvalue decomposition, select principal components that explain high variance, and finally project the original data onto these principal components. The extracted characteristic wavelengths of water are: 1405.8nm, 903.07nm, 919.62nm, 1408.99nm; the characteristic wavelengths of protein are: 1251.11nm, 903.07nm, 1431.33nm, 909.69nm; the characteristic wavelengths of fat are: 1208.84nm, 903.07nm, 1482.17nm, 1675.86nm.
[0062] Step 5: Establish a model. Use the PLS (partial least squares algorithm) model to predict the moisture content, protein content and fat content of soybeans based on the characteristic wavelength as the input feature.
[0063] Step 6: Output the actual and predicted values of soybean moisture content, protein content, and fat content for comparison. Figure 5 (a), (b) and (c) are comparison charts of the actual and predicted values of soybean moisture content, protein and fat content, respectively.
[0064] Step 7: Use the least squares method to estimate the model parameters, with the goal of minimizing the mean square error between the predicted value and the actual value. The fitting results show that the R 2 The value was 0.98, and the root mean square error (RMSE) was 0.0041; the R 2 The value is 0.90, and the root mean square error (RMSE) is 0.0032; the R 2 The value is 0.85 and the root mean square error (RMSE) is 0.0085 which indicates a good model fit.
[0065] The preferred embodiments of the present invention are described in detail above in conjunction with the accompanying drawings. However, the present invention is not limited to the specific details in the above embodiments. Within the technical concept of the present invention, a variety of simple modifications can be made to the technical solution of the present invention, and these simple modifications all belong to the protection scope of the present invention.
[0066] It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, the present invention will not further describe various possible combinations.
Claims
1. A grain quality detection device based on near infrared spectroscopy analysis, characterized in that: The invention comprises an operation window (1), a sample box (2), a bracket (3), a guide rail (4), a motor (5), an optical fiber probe (6), a fixing frame (7), a light source unit (8), a spectrum detection unit (9), a control unit (10), a host computer unit (11), a housing (12), and a sample to be measured (13); wherein the operation window (1) is a fixed opening on the upper part of the housing (12), located on one side of the top of the housing (12); during measurement, the sample box (2) is taken in and put out through the operation window (1); the sample box (2) is used to contain the sample and is placed on the bracket (3); the bracket (3) is fixed on a sliding platform of the guide rail (4), and the guide rail (4) is fixed on one side of the inner wall of the container housing and plays a role of movement and support; the motor (5) is located on one side of the guide rail (4) and is used to drive the guide rail (4) to realize the horizontal movement of the bracket (3); the optical fiber probe (6) is fixed in the measurement area, located below the sample box, and is used to send out a spectrum signal and simultaneously measure the reflection spectrum. One end of the fixing frame (7) is fixed to the outer wall, and the other end is fixed to clamp the optical fiber probe (6) and the transmitting and receiving optical fiber line; one end of the light source unit (8) is connected to the control unit (10), and the other end is connected to the transmitting optical fiber line, and the control unit (10) controls the light source unit (8) to send a spectrum signal to the optical fiber probe (6); one end of the spectrum detection unit (9) is connected to the control unit (10), and the other end is connected to the receiving optical fiber line, and the spectrum detection unit (9) receives the near-infrared light reflection signal collected by the optical fiber probe, and after photoelectric conversion processing, generates corresponding spectrum data and transmits it back to the control unit (10); the control unit (10) is connected to the motor (5) and the host computer unit (11), and is used to receive host computer instructions, control the spectrum transmission and reception of the light source unit (8) and the spectrum detection unit (9), and control the rotation of the motor (5); the host computer unit (11) reads the spectrum data, performs calculation processing, and obtains the measurement result.
2. A grain quality detection device based on near infrared spectroscopy analysis as claimed in claim 1, characterized in that: The material of the sample box (2) is high-purity fused quartz with high light transmittance; The main body material of the bracket (3) is metal; its size matches the outer diameter of the sample box; its base is horizontal to ensure the stability of spectrum collection during the measurement process; and its middle opening is light-transmissive and does not affect the passage of measurement light.
3. A grain quality detection device based on near infrared spectroscopy analysis as claimed in claim 1, characterized in that: The sample (13) to be measured is grain, which is ground into powder during the measurement process, placed inside the sample box (2) and compacted.
4. A grain quality detection device based on near infrared spectroscopy analysis as claimed in claim 1, characterized in that: The optical fiber probe (6) is located below the sample box (2), and the center of the probe is a multi-core optical fiber, including a transmitting optical fiber bundle and a receiving optical fiber bundle.
5. The grain quality detection device based on near infrared spectroscopy analysis according to claim 1, characterized in that: The fixing frame (7) adopts a clamping structure and is fixed by bolts so that the optical fiber probe is fixed on the bracket.
6. A grain quality detection device based on near infrared spectroscopy analysis as claimed in claim 1, characterized in that: The motor (5) has a limiting function, and adjusts the moving speed and position according to a preset program, so as to accurately control the movement of the sample holder in the measurement area and the operation area.
7. A grain quality detection device based on near infrared spectroscopy analysis as claimed in claim 1, characterized in that: The light source unit (8) emits a spectrum with a wavelength range of not less than 800 nm to 2500 nm, and an output power range of 1-10 MW; The effective range of the spectrum detection unit (9) is not less than 900nm to 1700nm.
8. The grain quality detection device based on near infrared spectroscopy analysis according to claim 1, characterized in that: The control unit (10) shown is developed using a 32-bit single-chip microcomputer or an embedded system, and uses a USB serial port for data communication.
9. The detection method of a grain quality detection device based on near infrared spectroscopy analysis according to claim 1, characterized in that: The specific steps are as follows: Step 1, initial reset; The control unit (10) completes initialization, resets the light source unit (8) and the spectrum detection unit (9), and controls the motor (5) to rotate the guide rail (4) to reset the bracket (3) to below the operating window (1); Step 2: No-load detection; The empty sample box (2) is placed on the bracket (3), the motor (5) drives the guide rail (4) to move the bracket (3) to the measurement area and position it above the optical fiber probe (6), the control unit (10) starts the measurement program, controls the spectrum detection unit (9) to collect the empty spectrum data, and uploads it to the host computer unit (11); Step 3, intermediate reset; Repeat step 1, the system performs a reset operation, and resets the bracket to the measurement window; Step 4: Full load test; The sample grain to be tested is filled into a sample box, and the sample box is placed on a bracket; a motor (5) controls a guide rail (4) to move the sample box (2) to a spectrum measurement area; in the measurement area, a control unit (10) starts a measurement program, controls a spectrum detection unit (9) to collect full-load spectrum data, and uploads the data to a host computer unit (11); Step 5: parameter prediction; The upper computer unit (11) calls the parameter conversion algorithm to calculate and output relevant quality parameters, including: predicted values of moisture content, protein content and fat content.
10. A method for detecting grain quality based on near infrared spectroscopy according to claim 1, characterized in that: In step 5, the parameter conversion algorithm specifically includes the following steps: S51, using multivariate scattering correction algorithm to perform spectral preprocessing, remove outliers in the data, and correct spectral differences between samples; S52, extracting characteristic wavelengths using a principal component analysis algorithm, preparing data and constructing a matrix, calculating a covariance matrix, performing eigenvalue decomposition, selecting principal components that explain high variance, and finally projecting the original data onto the principal components; S53. Use partial least squares algorithm to predict the moisture content, protein and fat content of soybeans based on the characteristic wavelength as input feature.