A method for detecting the internal quality of fresh corn ears by near-infrared rays and a probe device

By optimizing the detection distance and light source angle through simulation systems and algorithms, and combining them with characteristic band modeling, the problem of insufficient accuracy in the detection of fresh corn ears was solved, and high-precision quality detection and rapid online sorting were achieved.

CN120609780BActive Publication Date: 2026-02-27ACADEMY OF PLANNING & DESIGNING OF THE MINIST OF AGRI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510904743.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-01
Publication Date
2026-02-27
Estimated Expiration
2045-07-01

AI Technical Summary

Technical Problem

In existing technologies, near-infrared detection methods for fresh corn ears lack optimization methods for detection distance and light source angle, resulting in insufficient accuracy and stability of the detection model, and failing to effectively sort out overly old or underly young ears, affecting quality assurance.

Method used

By establishing a simulation system for the propagation of near-infrared light within the ear, the Monte Carlo method is used to simulate photon transmission. Combined with the elliptical Gaussian scattering model and optical characteristic parameters, the optimal detection distance and light source angle are determined. Furthermore, algorithms such as SPXY, SNV, and CARS are used to construct a prediction model, enabling accurate detection of the internal quality of fresh corn ears.

Benefits of technology

It improves the prediction accuracy of moisture content and soluble solids content in fresh corn ears, enables rapid online detection, meets the real-time detection needs of the production line, and ensures the accuracy and stability of quality sorting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120609780B_ABST
    Figure CN120609780B_ABST
Patent Text Reader

Abstract

The application discloses a kind of fresh corn ear internal quality near-infrared detection method and probe device, belongs to fresh corn quality detection technical field;Near-infrared detection method is based on the physical characteristics of fresh corn ear, detection device and optical characteristic parameter, establishes the simulation system of near-infrared light in ear propagation;Simulation system simulates the transmission process of photon in ear under different detection distances and different light source angles by Monte Carlo method, and obtains corresponding irradiance uniformity;Obtain the spectrum of ear at different detection distances and light source angles through experiment, and calculate corresponding spectral area range;According to the analysis of irradiance uniformity and spectral area range, determine the final detection distance and light source angle, then acquire the near-infrared spectrum of ear, and predict the internal quality of fresh corn ear;The application can obtain optimal detection distance and light source angle through simulation and experimental fitting, and then improve the prediction model precision of fresh corn moisture content and SSC.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of fresh corn quality detection technology, specifically relating to a near-infrared detection method and probe device for the internal quality of fresh corn ears. Background Technology

[0002] Sweet corn is a type of corn harvested at the milk stage for processing or direct consumption. It is characterized by its good taste, rich nutritional content, and high economic value, and is widely cultivated in China. Sweet corn emphasizes taste and requires a suitable level of maturity; the industry generally uses moisture content and soluble solids as key indicators of its intrinsic quality. Due to the short harvest period and variations in growing conditions, the maturity and taste of sweet corn vary considerably. During production, overly mature or underdeveloped ears need to be removed, currently relying mainly on experienced workers for selection. However, due to subjective human factors and the effects of long hours working under heavy loads, the intrinsic quality of sweet corn is difficult to guarantee, necessitating technological assistance to aid in ear sorting and grading.

[0003] Near-infrared spectroscopy (NIRS) technology enables the acquisition and evaluation of the intrinsic quality information of materials without damaging the sample. It is widely used in the internal quality detection of agricultural products. It utilizes the characteristics of fruit and vegetable tissues to reflect NIR reflection, scattering, transmission, and absorption to reflect the internal tissue composition information of fruits and vegetables.

[0004] Currently, near-infrared spectroscopy relies on chemometrics to model and analyze signals and agricultural product quality indicators. However, near-infrared measurement approximates the combined effect of absorption and scattering. It cannot separate absorption and scattering, weakening its ability to reflect tissue structure characteristics. This can easily lead to the loss of key information and reduce the accuracy, stability, and versatility of prediction models.

[0005] In the existing technology, there is no method for optimizing the detection distance and light source angle of fresh corn ears, nor is there a method for determining the number of sampling areas and collection points. Summary of the Invention

[0006] To address the shortcomings of existing technologies, this invention provides a near-infrared detection method and probe device for the internal quality of fresh corn ears.

[0007] The first aspect of this invention provides a method for detecting the intrinsic quality of fresh corn ears, comprising the following steps:

[0008] Based on the physical characteristics, detection devices, and optical properties of fresh corn ears, a simulation system for the propagation of near-infrared light within the ears was established.

[0009] The simulation system uses the Monte Carlo method to simulate the transmission process of photons in the ear of fruit under different detection distances and different light source angles, and obtains the corresponding irradiance uniformity.

[0010] The spike spectra were obtained through experiments at different detection distances and light source angles, and the corresponding spectral surface differences were calculated.

[0011] Based on the analysis and judgment of the difference between irradiance uniformity and spectral surface area, the final detection distance and light source angle are determined;

[0012] Based on the final detection distance and light source angle, the internal quality of fresh corn ears is predicted by collecting near-infrared spectra of the ears.

[0013] According to the method for detecting the intrinsic quality of fresh corn ears as described above, the optical characteristic parameters of the ears include: absorption coefficient μ. a scattering coefficient μ s Reduced scattering coefficient μ′ s and anisotropy factor g;

[0014] Randomly input μ based on the properties of the ear of fruit. a With μ s The value of , and through the scattering coefficient μ s The reduced scattering coefficient μ′ is calculated by multiplying by (1-g). s .

[0015] According to the method for detecting the intrinsic quality of fresh corn ears, the physical characteristics of the ears include at least: the kernels and the cob; wherein, an elliptical Gaussian scattering model is used to model the photon scattering behavior in the kernels, and the cob is set to be a total absorber with no scattering medium.

[0016] According to the aforementioned method for detecting the intrinsic quality of fresh corn ears, the step of determining the final detection distance and light source angle based on the analysis of the difference between irradiance uniformity and spectral surface area specifically includes:

[0017] Calculate the relative error between the relative rate of change of spectral surface area difference and the relative rate of change of irradiance uniformity for the same detection distance and light source angle. The detection distance and light source angle corresponding to the minimum relative error are the final detection distance and light source angle.

[0018] According to the aforementioned method for detecting the intrinsic quality of fresh corn ears, the collection of near-infrared spectra of the ears specifically includes:

[0019] N fresh corn ear samples of the same variety and size as those used in the experiment were selected, and the middle section of each sample was used as the spectral acquisition area.

[0020] Each sample is rotated once, and within the rotation period, the middle section of the ear of fruit is divided into M different collection point regions. n near-infrared spectra are collected from each collection point region. The average spectrum of the n near-infrared spectra collected from each collection point region is used as the original spectrum of that collection point region, and the original spectrum set is formed.

[0021] According to the method for detecting the intrinsic quality of fresh corn ears, after collecting the ear spectrum, several kernels were peeled off from the middle section of each sample and divided into two groups. The measured moisture content and SSC value were measured respectively.

[0022] Remove outlier data from the measured moisture content values ​​to construct a dataset of measured moisture content values; remove outlier data from the measured SSC values ​​to construct a dataset of measured SSC values.

[0023] The SPXY algorithm was used to divide the measured moisture content dataset and the SSC measured value dataset into a calibration set and a prediction set, respectively.

[0024] According to the method for detecting the intrinsic quality of fresh corn ears, the original spectral set is preprocessed by SG, the moisture content of fresh corn is modeled by PLSR, and the moisture content of the ears is detected by the SG-PLSR model.

[0025] Based on the SG-PLSR model, prediction models for the average spectrum of the middle section of the ear at different sampling points (1-M) were constructed. These models were then analyzed using R... 2 Determine the values ​​of RMSEP and RPD to select the final number of collection point areas.

[0026] According to the method for detecting the intrinsic quality of fresh corn ears, the original spectral set is preprocessed by SNV, the original spectral set is feature extracted by CARS algorithm, the SSC value of fresh corn is modeled by SVR, and the SSC value of the ears is detected by SNV-CARS-SVR model.

[0027] A second aspect of the present invention provides a probe device, comprising: a bracket, a halogen lamp reflector, and an optical fiber receiver head; the bracket comprises: a U-shaped bracket and an inclined bracket, the inclined brackets being symmetrically arranged at both ends of the bottom of the U-shaped bracket, the inclined brackets having at least three fixing slots, a halogen lamp reflector being disposed in the fixing slots, a halogen lamp being inserted into the halogen lamp reflector, a cylindrical platform protruding outwards at the top of the U-shaped bracket corresponding to the center of the fixing slots, a movable slot being formed along the longitudinal direction of the cylindrical platform, the movable slot penetrating the U-shaped bracket and the cylindrical platform, and an optical fiber receiver head being disposed inside the movable slot;

[0028] An optical fiber receiver head corresponds to a pair of halogen lamp cups on both sides to jointly detect one position spectral information; the probe device can acquire no less than three position spectral information at a time.

[0029] According to the probe device, the central axis of the symmetrically arranged halogen lamp cups is at the same angle as the central axis of the fiber optic receiver head, and the fiber optic receiver head is used to receive the diffuse reflected light after the halogen lamp acts on the ear of fruit.

[0030] Compared with the prior art, the beneficial effects of the present invention include at least the following:

[0031] 1. This invention designs a modeling and simulation method. By fitting simulation with experiments, the optimal detection distance and light source angle of fresh corn ears of this variety and size can be obtained. Under this detection distance and light source angle, the accuracy of the fresh corn moisture content and SSC prediction model is the highest.

[0032] 2. This invention clarifies a near-infrared detection method for the intrinsic quality of fresh corn ears, specifically including a method for determining the sampling area and the number of collection point areas, as well as the establishment of a prediction model;

[0033] 3. This invention can not only meet the static modeling experiment of the internal quality of fresh corn ears, but also be used for rapid online detection of the internal quality of fresh corn ears, and deployed in the production line for real-time detection.

[0034] 4. This invention designs a near-infrared probe device suitable for fresh corn ears, which can quickly detect spectral data in multiple regions. Attached Figure Description

[0035] Figure 1 This is a flowchart of the detection method of the present invention;

[0036] Figure 2 This is a simulation flowchart of the present invention;

[0037] Figure 3 This is an enlarged view of c in the simulation flowchart of the present invention;

[0038] Figure 4 This is a schematic diagram of corn ear spectral acquisition in Embodiment 2 of the present invention;

[0039] Figure 5 This is a schematic diagram of corn ear spectral acquisition in Embodiment 3 of the present invention;

[0040] Figure 6 The SSC value detection, SNV, MSC and FD preprocessed spectra are shown in the present invention.

[0041] Figure 7 The graph shows the number of characteristic wavelengths selected, the RMSECV change trajectory, and the trend of wavelength regression coefficients when selecting characteristic bands using the CARS algorithm in this invention.

[0042] Figure 8 This invention describes the process of selecting characteristic wavelengths using the SPA algorithm and the characteristic wavelength selection diagram using the SPA algorithm.

[0043] Figure 9 This is the probability plot for the RF variable selection in this invention;

[0044] Figure 10Scatter plots of predictions from the SNV-CARS-PLSR and SNV-CARS-SVR models in the SSC detection model of this invention.

[0045] Figure 11 This is a schematic diagram of the probe device in a preferred embodiment of the present invention;

[0046] Figure 12 This is a three-dimensional structural diagram of the probe device of the present invention;

[0047] Figure 13 This is a three-dimensional structural diagram of the tilting bracket of the probe device of the present invention;

[0048] In the diagram: 100, bracket; 200, halogen lamp cup; 110, U-shaped bracket; 120, tilting bracket; 130, cylindrical platform. Detailed Implementation

[0049] The technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit this disclosure or its application or use. All other embodiments obtained by those skilled in the art based on the embodiments of this disclosure without creative effort are within the scope of protection of this disclosure.

[0050] Unless otherwise specifically stated, the relative arrangement, numerical expressions, and values ​​of the components and steps set forth in these embodiments do not limit the scope of this disclosure.

[0051] At the same time, it should be understood that, for ease of description, the dimensions of the various parts shown in the accompanying drawings are not drawn according to actual scale.

[0052] Techniques, methods, and equipment known to those skilled in the art may not be discussed in detail, but where appropriate, such techniques, methods, and equipment should be considered part of the specification.

[0053] In all examples shown and discussed herein, any specific values ​​should be interpreted as merely exemplary and not as limitations. Therefore, other examples of exemplary embodiments may have different values.

[0054] It should be noted that similar labels and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be discussed further in subsequent figures.

[0055] like Figure 1As shown, Embodiment 1 of the present invention provides a near-infrared detection method for the internal quality of fresh corn ears, comprising the following steps:

[0056] Step S110: Based on the physical characteristics, detection device and optical properties of fresh corn ears, establish a simulation system for the propagation of near-infrared light within the ears.

[0057] In one embodiment, such as Figure 2 As shown in (a), in the three-dimensional modeling of fresh corn ears, a three-dimensional model with the physical characteristics of corn ears is established based on information such as the radius of the middle section of the ear, the size of the cob, the kernels, and the gaps.

[0058] In the modeling of the detection device, a halogen lamp model is constructed, and the light source is simplified to a surface light source, focused at the origin. The luminous parameters are assigned according to the data provided by the manufacturer. The fiber optic receiver head is a cylindrical model. A receiver is set on the receiving surface of the fiber optic receiver head to collect light data, so as to obtain the light flux received by the fiber optic receiver head under different detection distances and light source angles, and to calculate the irradiance uniformity of its receiving surface.

[0059] like Figure 2 As shown in (b), the origin of the coordinate axis is set at the center of the corn ear, and the centerline of the fiber optic receiver is perpendicular to the Z-axis. By adjusting the Z-axis coordinate, detection at different distances h can be achieved. The halogen lamp light source and the fiber optic detector are on the same plane, and the angle between the halogen lamp and the fiber optic receiver is used to define different incident light source angles. By adjusting the angle θ, the incident light source angle is changed.

[0060] In one embodiment, the optical properties of fresh corn ears include the absorption coefficient μ. a scattering coefficient μ s Reduced scattering coefficient μ′ s and anisotropy factor g;

[0061] Where, μ a denoted as ρ, represents the probability of a photon being absorbed per unit length, indicating the light energy lost per unit path due to absorption. g is a dimensionless parameter characterizing the non-uniformity of light distribution in the tissue and the probability of forward scattering, with a value range of [-1, 1]. In this embodiment, g is set to 0.85. Since light exhibits anisotropy during propagation, the reduced scattering coefficient is incorporated into the optical characteristic parameters. Therefore, the reduced scattering coefficient μ′ is calculated using the following formula. s :

[0062] μ′ s =μ s (1-g)

[0063] When building the simulation system, μ is input based on the material properties. a With μs The value of μ in this embodiment is... a Take 0.5cm -1 μ s Take 1.0mm -1 .

[0064] Since fresh corn ears absorb light primarily through water absorption, the absorption coefficient μ can also be calculated using the following formula. a :

[0065] μ a =W f μ a.water

[0066] In the formula, W f It is the water concentration, μ a.water It is the light absorption coefficient of water.

[0067] In one embodiment, an elliptic Gaussian scattering model is used to model the photon scattering behavior in the kernels of the ear, with the ear axis set to be a total absorber and without a scattering medium.

[0068] The energy scattering distribution of the elliptic Gaussian scattering model can be described by the following formula:

[0069]

[0070] p(θ) is the intensity or brightness in the θ direction, p0 is the intensity or brightness in the specular direction, φ is the azimuth scattering angle in the cosine space direction, measured from the surface x-axis, σ x It is the standard deviation of a Gaussian distribution parallel to the x-axis of the surface, σ y It is the standard deviation of a Gaussian distribution parallel to the y-axis of the surface.

[0071] In one embodiment, a 3D model of the sweet corn ear and detection system is created using SolidWorks, and optical simulation is performed using Lighttools software to simulate the photon transmission process within the sweet corn tissue. Figure 2 As shown in (a).

[0072] Step S120: The simulation system simulates the transmission process of photons in the ear of fruit under different detection distances and different light source angles using the Monte Carlo method, and obtains the corresponding irradiance uniformity, while recording the light distribution characteristics.

[0073] The light distribution characteristics include reflectivity and / or transmittance.

[0074] When a photon enters the tissue, it will be partially absorbed and scattered each time it moves one step randomly due to collisions with corn tissue particles, causing the photon's weight to gradually decrease.

[0075] The photon weight w is updated according to the following function:

[0076]

[0077] Where: μ a It is the absorption coefficient of the tissue; μ s It is the scattering coefficient of the tissue.

[0078] Step S130: Obtain the ear spectrum at different detection distances and light source angles through experiments, and calculate the corresponding spectral surface area difference.

[0079] The process of obtaining the ear-of-grain spectra at different detection distances and light source angles through experiments specifically includes:

[0080] Step S131: Select N fresh corn ear samples, and divide the middle section of the ear into M different collection point regions within the rotation period. Collect a near-infrared spectrum for each collection point region.

[0081] Step S132: Using the surface of the middle section of the ear as the sampling area, rotate the sample around the central axis of the ear in a circle. The rotation angle is random each time, and each sample is rotated 360°. Collect the spectrum of fresh corn ears at different detection distances and light source angles. Then, calculate the average spectrum of each spectrum. Measure each sample with different configuration parameters N times. Take the average of the N spectra as the original spectrum of the sample and generate the original spectrum sample set.

[0082] Step S133: Fresh corn samples are divided using the SPXY method. Then, the Standard Normal Variable Transform (SNV) is used for spectral preprocessing of the fresh corn sample spectra. Finally, the Support Vector Machine (SVM) algorithm is used to correlate the spectral information with the measured moisture content and / or measured SSC values ​​to establish a quantitative analysis and detection model for the intrinsic quality of fresh corn. SNV standardizes each spectral data point, eliminating the dimensions of the independent variable, as shown in the following formula:

[0083]

[0084] X is the original spectrum. is the average value of each spectrum, and SD is the standard deviation of each spectrum.

[0085] It is possible Figure 3 The apparatus in the experiment is used to perform the experiments described in steps S130 to S133.

[0086] Irradiance uniformity is used to evaluate the degree of uniformity of light distribution on the receiving surface. Specifically, it measures the degree of fluctuation in light intensity and describes the uniformity of the light source distribution on the receiving surface. In applications requiring precise light distribution, ensuring consistent light intensity is crucial for performance. A higher irradiance uniformity value indicates more uniform light distribution on the receiving surface, a smaller standard deviation, and less difference in light intensity at each location on the receiving surface; conversely, a lower irradiance uniformity value indicates a more uneven light distribution on the receiving surface. Irradiance uniformity is the relative standard deviation of irradiance at different locations on the light exit plane, calculated using the following formula:

[0087]

[0088] Where U represents irradiance uniformity, indicating the degree of uniformity of light intensity on the receiving surface; E i These represent irradiance values ​​at different locations; std(E) represents the average irradiance at different locations. i ) represents the standard deviation of irradiance at different locations.

[0089] Step S140: Based on the analysis and judgment of the difference between irradiance uniformity and spectral surface area, determine the final detection distance and light source angle;

[0090] The difference in spectral surface area is the sum of the areas of the curves between the highest and lowest absorbance values ​​at each spectral point of a set of spectral curves, calculated by the following formula:

[0091]

[0092] In the formula, SAD represents the differential integral absorbance; X i These are the spectral values ​​at each wavelength point; It is the overall average spectral value; N is the total number of wavelength points; X max,i X is the absorbance of the highest spectrum at the i-th wavelength. min,i It is the absorbance of the lowest spectrum at the i-th wavelength; Δλ i It is the distance between adjacent wavelengths.

[0093] In one embodiment, the relative error between the relative rate of change of spectral surface area difference and the relative rate of change of irradiance uniformity for the same detection distance and light source angle is calculated, and the detection distance and light source angle corresponding to the minimum relative error are the final detection distance and light source angle.

[0094] Step S150: Based on the final detection distance and light source angle, the internal quality of fresh corn ears is predicted by collecting the near-infrared spectrum of the ears.

[0095] The near-infrared spectrum of the collected fruit ears specifically includes:

[0096] Step S151: Select N fresh corn ear samples of the same variety and size as those in the experiment, and use the middle section of each sample as the spectral acquisition area.

[0097] In step S152, each sample is rotated once, and within the rotation period, the middle section of the ear of fruit is divided into M different collection point regions. n near-infrared spectra are collected from each collection point region. The average spectrum of the n near-infrared spectra collected from each collection point region is used as the original spectrum of that collection point region, and the original spectrum set is formed.

[0098] Step S153: After collecting the spikelet spectrum, remove a number of kernels from the middle section of each sample, divide them into two groups, and measure the actual moisture content and SSC value respectively.

[0099] Step S154: Remove outlier data from the measured moisture content values ​​and construct a dataset of measured moisture content values; remove outlier data from the measured SSC values ​​and construct a dataset of measured SSC values.

[0100] In one embodiment, outlier data is removed using the Z-score algorithm.

[0101] Step S155: The measured moisture content dataset and the measured SSC dataset are divided into a calibration set and a prediction set respectively using the SPXY algorithm.

[0102] Step S156: Preprocess the original spectral set using SG, model the moisture content of fresh corn and vegetables using PLSR, and then detect the moisture content of the ears using the SG-PLSR model.

[0103] Based on the SG-PLSR model, prediction models for the average spectrum of the middle section of the ear at different sampling points (1-M) were constructed. These models were then analyzed using R... 2 Determine the values ​​of RMSEP and RPD to select the final number of collection point areas.

[0104] Step S157: Preprocess the original spectral set using SNV, extract features from the original spectral set using the CARS algorithm, model the SSC value of fresh corn fruits and vegetables using SVR, and then detect the SSC value of the ears using the SNV-CARS-SVR model.

[0105] In one embodiment, the performance of the established model is evaluated by the correlation coefficient R², root mean square error RMSE, and residual prediction bias RPD, wherein the formula for calculating RPD is as follows:

[0106]

[0107] Embodiment 2 of the present invention provides a method for detecting the internal quality of fresh corn ears, specifically a method for detecting the moisture content of the ears, comprising the following steps:

[0108] Step S201, as follows Figure 4 As shown in (c), 90 samples of the same variety and size as those in the experiment were selected and divided into three equal segments, which were defined as the first segment, the middle segment and the last segment, respectively.

[0109] In step S202, each sample is rotated 360°, and within the rotation period, the ear of fruit is divided into 6 different sampling point areas at intervals. The sampling point in the middle section is shown in the figure below. Figure 4 As shown in (c); the original waveforms of the 6 acquisition point areas are as follows: Figure 4 As shown in (f), the average spectrum of different sampling point regions, as follows Figure 4 As shown in (e).

[0110] Step S203: Collect 18 spectra for each ear of fruit, collect 540 spectra for each segment of all samples, and collect a total of 1620 spectra for the first, middle, and last segments. The overall raw spectrum is as follows: Figure 4 As shown in (d).

[0111] Step S204: After the spectral acquisition is completed, the moisture content of the first, middle and last sections of the fresh corn ear is measured respectively.

[0112] Step S205: Remove outliers using the Z-score method;

[0113] Step S206: The measured moisture content dataset is divided into a calibration set and a prediction set using the SPXY algorithm.

[0114] Step S207: The spectral data is preprocessed using methods such as no preprocessing (NONE), standard normal variable transformation (SNV), multivariate scattering correction (MSC), first derivative (1D), second derivative (2D), and convolution smoothing (SG). PLSR is then used to model the moisture content of fresh corn. To avoid underfitting or overfitting when establishing the calibration model using PLSR, the optimal number of latent variables (LVs) participating in the modeling is selected. The optimal number of principal components is determined by the LVs corresponding to the minimum sum of squared predicted residuals.

[0115] Step S208, Global Modeling:

[0116] A prediction model for the moisture content of fresh corn ears was established using preprocessing methods such as NONE, SNV, MSC, SG, 1D, and 2D combined with the PLSR model. As shown in Table 1, a global model covering the entire region of fresh corn ears under different preprocessing conditions was established, including the first, middle, and last segments.

[0117] Table 1. Prediction results of the global model for moisture content of fresh corn ears.

[0118]

[0119] A high LVs in global modeling indicates that the global model is not adaptable to the data, has a complex model structure, and has weak generalization ability.

[0120] Step S209: Establish prediction models for different body parts:

[0121] To further improve detection accuracy, local prediction models for different parts of the ear were established, as shown in Table 2.

[0122] Table 2 Prediction results of PLSR model under different preprocessing methods

[0123]

[0124] As shown in Table 2, in the modeling of the first segment of the ear, the model after 1D preprocessing has the highest accuracy, and the modeling results are... RMSEP and RPD were 0.937, 0.009, and 4.114, respectively, and LVs was 9. In the modeling of the middle section of the ear, the model with SG smoothing preprocessing had the highest accuracy. RMSEP and RPD were 0.955, 0.007, and 4.884, respectively, and LVs was 8. In the modeling of the ear tail section, the model with the highest accuracy was obtained after 1D preprocessing. RMSEP and RPD were 0.840, 0.001, and 2.579, respectively, and LVs was 6. Comparative analysis of the model prediction results revealed that the modeling effect was best for the middle section of the ear.

[0125] Step S210: Establish prediction models for the first, middle, and last segments of the ear of fruit, and cross-validate the models for different ear segments.

[0126] Table 3 Cross-validation of different ear segments

[0127]

[0128] As shown in Table 3, each model performed best in predicting the moisture content of its respective segment, while the prediction results decreased when predicting other segments. The average RMSEP of the three models when predicting different ear segments was calculated, and the results were 0.0167, 0.014, and 0.0160, respectively. The results show that the mid-ear prediction model had the lowest RMSEP when predicting the first, middle, and last segments, indicating that the moisture content prediction model established in the mid-ear segment has better generalization ability.

[0129] Step S211: Establish prediction models for different sampling points based on the SG-PLSR model; prediction models for the average spectrum of the middle section of the ear at six different sampling points were constructed, as shown in Table 4.

[0130] Table 4. Modeling results of the number of different sampling points in the middle section of the ear.

[0131]

[0132] When the number of data collection points increases to 5, the model's prediction accuracy reaches its optimal level. The RMSEP and RPD values ​​were 0.967, 0.007, and 5.647, respectively.

[0133] This embodiment clarifies the near-infrared detection method for moisture content of fresh corn ears, specifically including the method for determining the sampling area and the number of collection points, as well as the process for establishing a prediction model. This invention can not only meet the needs of static modeling experiments on the internal quality of fresh corn ears, but also be used for rapid online detection of the internal quality of fresh corn ears, and can be deployed in the production line for real-time detection.

[0134] Embodiment 3 of the present invention provides a method for detecting the intrinsic quality of fresh corn ears, specifically a method for detecting the SSC value of ears, comprising the following steps:

[0135] Step S301: Select 140 samples of the same variety and size as those used in the experiment for testing;

[0136] Step S302, as follows Figure 5 As shown, the middle section of fresh corn was selected as the sampling area. The equipment was preheated for 30 minutes before the experiment to reduce measurement deviations caused by temperature changes. During each measurement, the corn sample was rotated 360° around the central axis of the ear, and a total of 6 spectra were collected. The average of the 6 measurements was used as the original spectrum of the sample. A total of 140 samples were measured in this experiment, and 840 spectra were collected, resulting in 140 original average spectral data.

[0137] Step S303: The SSC value of each sample is measured one by one using the refractive instrument method;

[0138] Step S304: Remove outliers using the Z-score method;

[0139] Step S305: Divide the SSC measured value dataset into a calibration set and a prediction set using the SPXY algorithm;

[0140] Step S306, establish a full-band prediction model:

[0141] The spectral data were preprocessed using algorithms such as SGS, SNV, MSC, FD, and DT. Based on the full-band data, a prediction model for fresh corn sweet corn sweet SSC was established using PLSR. Through 10-fold cross-validation, the optimal number of latent variables (LVs) was determined by the root mean square error (RMSECV) of the cross-validation and the minimum value, as shown in Table 5.

[0142] Table 5. SSC full-band modeling results

[0143]

[0144] Table 5 shows that SNV preprocessing achieves the best results, and the test set... The RMSEP was increased to 0.764, the RMSEP decreased to 0.231, and the RPD increased to 2.131. The spectra after MSC, SNV, and FD preprocessing are as follows: Figure 6 As shown, MSC and SNV pretreatment effectively eliminated scattering effects caused by physical characteristics such as grain size and surface grooves, while FD pretreatment removed baseline drift in the spectrum. Figure 6 (a) is the spectrum after SNV preprocessing. Figure 6 (b) is the spectrum after MSC preprocessing. Figure 6 (c) is the spectrum after FD preprocessing.

[0145] Step 307, Establish the SSC characteristic band prediction model:

[0146] To reduce the interference of non-target components on SSC prediction, feature wavelengths are extracted from the preprocessed spectral data to reduce model complexity, weaken the influence of irrelevant information and noise, and enhance the model's generalization ability. Three preprocessing methods with good preprocessing effects (SNV, MSC, and FD) from Table 5 are selected, and feature wavelengths extracted by CARS, SPA, and RF feature extraction algorithms are combined to establish SSC prediction models based on feature band spectral information.

[0147] Table 6. Modeling Results of SSC Characteristic Bands

[0148]

[0149] As shown in Table 6, the CARS, SPA, and RF variable selection algorithms significantly reduce the number of feature wavelengths required for modeling. Compared to full-band modeling with SNV preprocessing without feature extraction, the CARS, SPA, and RF algorithms show superior performance on the test set. The values ​​reached 0.858, 0.808, and 0.831 respectively, representing improvements of 12.3%, 5.7%, and 8.7% compared to full-band modeling. This indicates that characteristic band modeling reduces model complexity while also improving prediction accuracy.

[0150] Analysis of the feature wavelength data extracted by different algorithms reveals that the number of feature wavelengths extracted by the RF, CARS, and SPA algorithms decreases progressively. Specifically, the CARS and RF algorithms extract feature wavelengths covering two regions: 1149–1242 nm and 1426–1483 nm, respectively, which contain important absorption peaks near 1200 nm and 1450 nm. In contrast, the feature wavelengths extracted by the SPA algorithm are mainly concentrated in the 1173–1263 nm range.

[0151] Step S3071, CARS algorithm selects feature bands:

[0152] Taking the SNV preprocessed data as an example, the CARS algorithm is used to extract features from the spectral data of fresh corn. The number of iterations is set to 50, and the resampling rate is 0.8. The CARS feature parameter extraction process is as follows: Figure 7 As shown. By Figure 7 (a) shows that as the number of iterations increases, the number of selected variables decreases from coarse to fine, effectively improving algorithm efficiency and eliminating a large amount of useless spectral information. Figure 7 As shown in (b), a large amount of information unrelated to fresh corn SSC was removed during the first 18 iterations, and RMSECV reached its lowest value in the 19th iteration. In subsequent iterations, effective spectral information was removed, and the RMSECV value began to rise. Figure 7 In (c), each curve represents the regression coefficient of each feature wavelength at different iterations. The straight line in the figure indicates the number of samplings corresponding to the minimum RMSECV value, which corresponds to the optimal set of feature wavelengths.

[0153] Step S3072, SPA algorithm selects characteristic bands:

[0154] When there is a strong correlation between wavelengths, the SPA algorithm can effectively reduce redundant features. The process of selecting feature wavelengths using the SPA algorithm is as follows: Figure 8 As shown in (a), when the number of characteristic wavelengths is selected as 24, the corresponding root mean square error (RMSE) is the lowest, at 0.253, at which point a large amount of collinearity information is eliminated. Figure 8 (b) It can be seen that the characteristic wavelengths selected by the SPA algorithm are mainly concentrated in the range of 1173 to 1263 nm. This absorption peak is mainly related to the second harmonic and combination absorption of the CH bond. There are fewer characteristic wavelengths selected near the absorption peak of 1450 nm.

[0155] Step S3073, RF algorithm selects characteristic bands:

[0156] Taking the data preprocessed by SNV as an example, the selection threshold for the RF algorithm is set to 0.2. The probability of selecting RF variables is as follows: Figure 9As shown in the figure, the characteristic variables in the intervals of 36–52, 55–67, 79–94, and 108–138 nm are selected with a high probability, corresponding to the near-infrared spectral regions of 1140–1210 nm, 1222–1271 nm, 1320–1381 nm, and 1438–1561 nm. The model selects characteristic wavelengths that only include 34.3% of the original spectral variables, reducing the number of wavelengths while decreasing redundant information and improving computational efficiency.

[0157] In the process of SSC full-band modeling and characteristic band modeling of fresh sweet corn, the SNV preprocessing method showed the best model prediction performance. Specifically, the training set of the best model using SNV preprocessing... The value is 0.869, RMSEC is 0.219, and the test set is... The values ​​were 0.858, RMSEP was 0.191, and RPD was 2.715. This indicates that SNV preprocessing has significant advantages in processing near-infrared spectral data of fresh corn.

[0158] By comparing the accuracy of feature band models under different preprocessing methods, it was found that the prediction accuracy of the model after feature extraction using the CARS algorithm is higher than that of the SPA and RF algorithms. Therefore, by combining appropriate spectral preprocessing methods with feature wavelength extraction algorithms, accurate prediction of the SSC value of fresh corn ears can be achieved.

[0159] Step S3084: Compare prediction models for different characteristic bands;

[0160] Data preprocessed by spectroscopic analysis and CARS feature band extraction were input into the SVR model, and the prediction results were compared with those of the PLSR model. SVR uses a radial basis function kernel, and particle swarm optimization (PSO) is used to optimize the penalty factor C and kernel parameter a. The algorithm parameters are set as follows: population size 30, number of iterations 50, and the range of the hyperparameters to be optimized [0.01, 100]. The prediction results are shown in Table 7. Comparing the data in Tables 6 and 7, it can be seen that for MSC and SNV preprocessing, the SVR feature band model performs slightly better than the PLSR feature band model. Among them, the "SNV-CARS-SVR" model has the best performance, and the training set... The value is 0.881, RMSEC is 0.207, and the test set is... The value is 0.869, RMSEP is 0.185, and RPD is 2.843. The scatter plot of the predictions from the characteristic band prediction model is shown below. Figure 10 As shown, where, Figure 10 (a)

[0161] Table 7 SVR Algorithm Modeling Results

[0162]

[0163] The "SNV-CARS-SVR" model built based on SVR is optimal, and its test set... The value is 0.869, RMSEP is 0.185, and RPD is 2.843.

[0164] This embodiment clarifies the near-infrared detection method for SSC value of fresh corn ears, specifically including the selection method of characteristic bands and the prediction model establishment process. This invention can not only meet the static modeling experiment of the internal quality of fresh corn ears, but also be used for rapid online detection of the internal quality of fresh corn ears, and deployed in the production line for real-time detection.

[0165] like Figure 12-13 As shown, Embodiment 4 of the present invention provides a probe device, including: a bracket 100, a halogen lamp cup 200, and an optical fiber receiver head;

[0166] The bracket 100 includes: a U-shaped bracket 110 and an inclined bracket 120. The inclined brackets 120 are symmetrically arranged at both ends of the bottom of the U-shaped bracket 110. The inclined brackets 120 have no less than three fixing slots. A halogen lamp cup 200 is provided in the fixing slot. A cylindrical platform 130 protruding outward is provided at the top of the U-shaped bracket 110 corresponding to the center of the fixing slot. The cylindrical platform 130 has a moving slot in the longitudinal direction. The moving slot passes through the U-shaped bracket 110 and the cylindrical platform 130. An optical fiber receiver head is provided inside the moving slot.

[0167] One fiber optic receiver head corresponds to a pair of halogen lamp cups 200 on both sides, jointly detecting one position spectral information; the probe device can acquire no less than three position spectral information at a time.

[0168] The central axis of the symmetrically arranged halogen lamp cup 200 is at the same angle as the central axis of the fiber optic receiver head. The fiber optic receiver head is used to receive the diffuse reflected light after the halogen lamp acts on the ear of fruit.

[0169] In a preferred embodiment, such as Figure 11 As shown, when the optimal light source angle determined by the simulation system is 45°, a probe device with the central axis of the halogen lamp cup 200 at 90° and the angle between the central axis of the fiber optic receiver head and the central axis of the halogen lamp cup 200 at 45° is used for detection. When the simulation system determines the optimal light source angle to be other angles, a probe device with other angles is used for detection.

[0170] The probe device in this embodiment is mainly designed for the shape of corn ears and can quickly detect spectral data from multiple regions.

[0171] In this embodiment, the corn ears are divided into three sections for testing, so the inclined support has three fixing slots.

[0172] In another embodiment, if the corn cob is divided into 4 sections, the inclined support 120 has four fixing slots.

[0173] Embodiment 5 of the present invention also provides a detection system, including: a power supply, a probe device, a near-infrared spectroscopy module, an edge computing module, and a display module;

[0174] The power supply provides the system with 24V voltage; the probe device realizes near-infrared light emission and diffuse reflection light reception, and the distance between the probe device and the material is 3-4cm; the near-infrared spectroscopy module collects the diffuse reflection light received by the probe device, performs photoelectric conversion to realize spectral signal output; the edge computing module realizes spectral signal preprocessing, and realizes the prediction of moisture content and soluble solids content through the intrinsic quality model; the display module displays the spectral curve and prediction results.

[0175] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the protection scope of the claims of the present invention.

Claims

1. A method for detecting the internal quality of fresh corn ears, characterized in that, Includes the following steps: Based on the physical characteristics, detection devices, and optical properties of fresh corn ears, a simulation system for the propagation of near-infrared light within the ears was established. The simulation system uses the Monte Carlo method to simulate the transmission process of photons in the ear of fruit under different detection distances and different light source angles, and obtains the corresponding irradiance uniformity. The spike spectra were obtained through experiments at different detection distances and light source angles, and the corresponding spectral surface differences were calculated. Based on the analysis and judgment of the irradiance uniformity and the spectral surface area difference, the final detection distance and light source angle are determined; the relative error between the relative change rate of the spectral surface area difference and the relative change rate of the irradiance uniformity for the same detection distance and light source angle is calculated, and the detection distance and light source angle corresponding to the minimum relative error are the final detection distance and light source angle. Based on the final detection distance and light source angle, the internal quality of fresh corn ears is predicted by collecting near-infrared spectra of the ears. The near-infrared spectrum of the corn ears is collected, specifically including: selecting N fresh corn ear samples of the same variety and size as the experimental sample, and using the middle section of each sample as the spectral collection area; Each sample was rotated once, and within the rotation period, the middle section of the ear was divided into M different sampling point regions. n near-infrared spectra were collected from each sampling point region. The average spectrum of the n near-infrared spectra collected from each sampling point region was used as the original spectrum for that region, forming the original spectrum set. After collecting the ear spectra, several kernels were removed from the middle section of each sample and divided into two groups. The measured moisture content and soluble solids content were measured separately. Outlier data in the measured moisture content values ​​were removed to construct a moisture content dataset. Similarly, outlier data in the measured soluble solids content values ​​were removed to construct a soluble solids content dataset. The SPXY algorithm was used to combine the moisture content and soluble solids content datasets. The dataset was divided into a calibration set and a prediction set. The original spectral set was preprocessed using SG, and the moisture content of fresh corn and vegetables was modeled using PLSR. The moisture content of the ears was then detected using the SG-PLSR model. Based on the SG-PLSR model, prediction models for the average spectra of the middle section of the ear in different sampling areas (number 1-M) were constructed. The final number of sampling areas was selected by judging the magnitudes of R2, RMSEP, and RPD. The original spectral set was preprocessed using SNV, and features were extracted from the original spectral set using the CARS algorithm. The soluble solids content of fresh corn and vegetables was modeled using SVR, and the soluble solids content of the ears was detected using the SNV-CARS-SVR model.

2. The method for detecting the intrinsic quality of fresh corn ears according to claim 1, characterized in that: The optical properties of the ear of fruit include: absorption coefficient. scattering coefficient Reduced scattering coefficient and anisotropy factor g; Random input based on the properties of the ear of fruit and The value, and through the scattering coefficient The reduced scattering coefficient is calculated by multiplying by (1-g). .

3. The method for detecting the intrinsic quality of fresh corn ears according to claim 1, characterized in that: The physical characteristics of the ear include at least: ear kernels and ear rachis; wherein, an elliptical Gaussian scattering model is used to model the photon scattering behavior in the ear kernels, and the ear rachis is set to be a total absorber with no scattering medium.