Near-infrared detection method and probe device for internal quality of fresh corn ears
By establishing a near-infrared light propagation simulation system and designing a probe device, the optimal detection distance and light source angle were determined, which solved the problem of insufficient model accuracy in fresh corn cob detection and achieved high-precision quality detection and rapid online detection.
Patent Information
- Application Number
- CN202510904743.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-01
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2045-07-01
AI Technical Summary
In the existing technology, the near-infrared detection method of fresh corn ears lacks a method to optimize the detection distance and light source angle, resulting in insufficient accuracy and stability of the detection model, which cannot effectively reflect the tissue structure characteristics. There is also a lack of a method to determine the sampling area and the number of collection points, which affects the accuracy of quality sorting.
By establishing a simulation system for the propagation of near-infrared light in the fruit cluster, using the Monte Carlo method to simulate photon transmission, combined with the elliptical Gaussian scattering model, the optimal detection distance and light source angle are determined, and the SPXY and SG-PLSR models are used for modeling. A moisture content and SSC prediction model is constructed, and a suitable probe device is designed to achieve rapid detection of multi-region spectral data.
The accuracy of internal quality detection of fresh corn ears has been improved, and rapid online detection can be achieved in the production line to ensure the accuracy and stability of quality sorting, meeting the needs of static modeling and real-time detection.
Smart Images

Figure CN120609780A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of fresh corn quality detection, and in particular relates to a near-infrared detection method and a probe device for the intrinsic quality of fresh corn ears. Background Art
[0002] Fresh corn is a type of corn that is picked during the milky stage for processing or direct consumption. It has the characteristics of good taste, rich nutrients and high economic value, and is widely cultivated in China. Fresh corn focuses on taste and pays attention to the right degree of maturity. The industry generally uses moisture content and soluble solids as the main indicators to measure the intrinsic quality of fresh corn. Due to the short harvest period and different planting conditions, the degree of maturity and taste vary. During the production process, it is necessary to remove old or young ears. Currently, the selection mainly relies on experienced workers. However, due to the influence of human subjective factors and long-term saturated work, the intrinsic quality of fresh corn is difficult to guarantee, and there is an urgent need for technological empowerment to assist in the sorting and grading of ears.
[0003] Near-infrared spectroscopy technology can obtain and evaluate the intrinsic quality information of materials without destroying the samples. It is widely used in the internal quality testing of agricultural products. It uses the reflection, scattering, transmission and absorption characteristics of fruit and vegetable tissues to reflect the internal tissue composition information of fruits and vegetables.
[0004] Currently, near-infrared spectroscopy technology relies on chemometric methods to model and analyze signals and agricultural product quality indicators. However, near-infrared measurements approximately describe the combined effects of absorption and scattering. It cannot separate absorption and scattering, weakening the ability to reflect tissue structure characteristics, easily leading to the loss of key information, and reducing the accuracy, stability and versatility of the prediction model.
[0005] In the prior art, 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 point areas. Summary of the Invention
[0006] In order to solve the deficiencies in the prior art, the present invention provides a near-infrared detection method and a probe device for the intrinsic quality of fresh corn ears.
[0007] A first aspect of the present invention provides a method for detecting the intrinsic quality of fresh corn ears, comprising the following steps:
[0008] Based on the physical characteristics, detection device and optical property parameters of fresh corn ears, a simulation system for near-infrared light propagation inside the ears was established.
[0009] The simulation system uses the Monte Carlo method to simulate the transmission process of photons in the fruit cluster at different detection distances and different light source angles, and obtains the corresponding irradiance uniformity;
[0010] The spectra of the fruit ears at different detection distances and light source angles were obtained through experiments, and the corresponding spectral surface deviations were calculated.
[0011] Determine the final detection distance and light source angle based on the analysis and judgment of irradiance uniformity and spectral surface difference;
[0012] Based on the final detection distance and light source angle, the intrinsic quality of fresh corn ears can be predicted by collecting the near-infrared spectrum of the ears.
[0013] According to the method for detecting the intrinsic quality of fresh corn ears, 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 μ according to the properties of the fruit cluster a With μ s The value of the scattering coefficient μ s The reduced scattering coefficient μ′ is calculated by multiplying it with (1-g) s .
[0015] According to the method for detecting the intrinsic quality of fresh corn cobs, the physical characteristics of the cob include at least: cob kernels and cob axis; wherein, an elliptical Gaussian scattering model is used to model the photon scattering behavior in the cob kernels, and the cob axis is set to be fully absorbing and without a scattering medium.
[0016] According to the method for detecting the intrinsic quality of fresh corn ears, the method of determining the final detection distance and light source angle based on the analysis of irradiance uniformity and spectral surface area difference specifically includes:
[0017] Calculate the relative error between the relative change rate of the spectral surface area difference and the relative change rate of the irradiance uniformity at 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 method for detecting the intrinsic quality of fresh corn ears, collecting the near-infrared spectrum of the ears specifically includes:
[0019] Select N fresh corn ear samples of the same variety and size as the experiment, and use the middle section of each sample as the spectrum collection area;
[0020] Each sample rotates once, and within the rotation cycle, the middle section of the ear is divided into M different collection point areas. N near-infrared spectra are collected in each collection point area. The average spectrum of the n near-infrared spectra collected in each collection point area is used as the original spectrum of the collection point area to form the original spectrum set.
[0021] According to the method for detecting the intrinsic quality of fresh corn ears, after collecting the spectrum of the ears, several kernels were peeled from the middle of each sample and divided into two groups, and the actual moisture content and SSC values were measured respectively;
[0022] Remove abnormal data from the measured values of moisture content and construct a dataset of measured values of moisture content; remove abnormal data from the measured values of SSC and construct a dataset of measured values of SSC;
[0023] The SPXY algorithm is used to divide the moisture content measured value dataset and the SSC measured value dataset into a calibration set and a prediction set respectively.
[0024] According to the described method for detecting the intrinsic quality of fresh corn ears, the original spectrum set is preprocessed by SG, the moisture content of fresh corn fruits and vegetables is modeled by PLSR, and then the moisture content of the ear is detected by the SG-PLSR model;
[0025] Based on the SG-PLSR model, prediction models of the average spectra of the middle section of the ear at different collection points (number 1-M) were constructed. 2 , RMSEP and RPD, and select the final number of collection point areas.
[0026] According to the described method for detecting the intrinsic quality of fresh corn ears, the original spectrum set is preprocessed by SNV, the features of the original spectrum set are extracted by the CARS algorithm, the SSC value of fresh corn fruits and vegetables is modeled by SVR, and then the SSC value of the ear is detected by the SNV-CARS-SVR model.
[0027] A second aspect of the present invention provides a probe device, comprising: a bracket, a halogen lamp cup, and an optical fiber receiving head; the bracket comprises: a concave bracket and an inclined bracket, the inclined brackets being symmetrically arranged at both ends of the bottom of the concave bracket, the inclined bracket having no less than three fixing grooves, the fixing grooves being provided with a halogen lamp cup, the halogen lamp being inserted into the halogen lamp cup, the top of the concave bracket being provided with a cylindrical platform protruding outward at a position corresponding to the center of the fixing groove, the cylindrical platform being provided with a movable groove in the longitudinal direction, the movable groove penetrating the concave bracket and the cylindrical platform, the movable groove being provided inside the optical fiber receiving head;
[0028] An optical fiber receiving head corresponds to a pair of halogen lamp cups on both sides, and jointly detects spectrum information of a position; the probe device can obtain spectrum information of no less than three positions at a time.
[0029] According to the probe device, the central axis of the symmetrically arranged halogen lamp cup has the same angle as the central axis of the optical fiber receiving head, and the optical fiber receiving head is used to receive the diffusely reflected light after the halogen lamp acts on the fruit cluster.
[0030] Compared with the prior art, the beneficial effects of the present invention include at least:
[0031] 1. The present invention designs a modeling and simulation method. By fitting simulation and experiment, the optimal detection distance and light source angle for fresh corn ears of this variety and size can be obtained. Under this detection distance and light source angle, the fresh corn moisture content and SSC prediction model with the highest accuracy is constructed.
[0032] 2. The present invention clarifies a near-infrared detection method for the intrinsic quality of fresh corn ears, specifically including a method for determining the number of sampling areas and collection points, and establishing a prediction model;
[0033] 3. The present invention can not only meet the requirements of static modeling experiments on the intrinsic quality of fresh corn ears, but can also be used for rapid online detection of the intrinsic quality of fresh corn ears and be deployed in production lines for real-time detection.
[0034] 4. The present invention designs a near-infrared special probe device suitable for fresh corn ears, which can quickly detect spectral data in multiple areas. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 Flow chart of the detection method of the present invention;
[0036] Figure 2 It is a simulation flow chart of the present invention;
[0037] Figure 3 It is an enlarged view of c in the simulation flow chart of the present invention;
[0038] Figure 4 This is a schematic diagram of collecting spectrum of corn ears in Example 2 of the present invention;
[0039] Figure 5 This is a schematic diagram of spectrum collection of corn ears in Example 3 of the present invention;
[0040] Figure 6 Spectra of the present invention during SSC value detection, SNV, MSC and after FD pretreatment;
[0041] Figure 7 The characteristic wavelength selection number, RMSECV change trajectory and wavelength regression coefficient trend chart when selecting characteristic bands through the CARS algorithm of the present invention;
[0042] Figure 8 The process of screening characteristic wavelengths by the SPA algorithm and the characteristic wavelength graph selected by the SPA algorithm of the present invention;
[0043] Figure 9 Selecting a probability map for the RF variable of the present invention;
[0044] Figure 10This is a scatter plot of the predictions of the SNV-CARS-PLSR model and the SNV-CARS-SVR model in the SSC detection model of the present invention.
[0045] Figure 11 Schematic diagram of the principle of the probe device in a preferred embodiment of the present invention;
[0046] Figure 12 It 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 tilt bracket of the probe device of the present invention;
[0048] In the figure: 1. bracket; 2. halogen lamp cup; 11. concave bracket; 12. tilt bracket; 13. cylindrical stand. DETAILED DESCRIPTION
[0049] The following will be combined with the drawings in the embodiments of the present disclosure to clearly and completely describe the technical solutions in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all the embodiments. The following description of at least one exemplary embodiment is actually only illustrative and is in no way intended to limit the present disclosure and its application or use. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present disclosure.
[0050] Unless specifically stated otherwise, the relative arrangement of components and steps, the numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present disclosure.
[0051] At the same time, it should be understood that for the convenience of description, the sizes of the various parts shown in the drawings are not drawn according to the actual proportional relationship.
[0052] Technologies, methods and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, such technologies, methods and equipment should be considered part of the authorization specification.
[0053] In all examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not limiting. Therefore, other examples of the exemplary embodiments may have different values.
[0054] It should be noted that like reference numerals and letters refer to like items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0055] like Figure 1As shown, Example 1 of the present invention provides a near-infrared detection method for the intrinsic quality of fresh corn ears, comprising the following steps:
[0056] Step S110, establishing a simulation system for near-infrared light propagation in a fresh corn ear based on the physical characteristics of the fresh corn ear, the detection device, and the optical characteristic parameters;
[0057] In one embodiment, Figure 2 As shown in (a), in the 3D modeling of fresh corn ears, a 3D model with the physical characteristics of the corn ear is established based on the radius of the middle section of the ear, the cob, the size of the kernels, the gap, and other information;
[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 on the origin, and the luminous parameters are assigned according to the data provided by the manufacturer; the optical fiber receiving head is a straight cylinder model, and a receiver is provided on the receiving surface of the optical fiber receiving head to collect light data to obtain the luminous flux received by the optical fiber receiving head at different detection distances and light source angles, and calculate the irradiance uniformity of its receiving surface.
[0059] like Figure 2 As shown in (b), the coordinate axis origin is set at the center of the corn ear, and the centerline of the fiber optic receiving head 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 in the same plane. The angle between the halogen lamp and the fiber optic receiving head is used to define different incident light angles. By adjusting the angle θ, the incident light angle can be changed.
[0060] In one embodiment, the optical characteristic parameters of the fresh corn ear include the absorption coefficient μ a , scattering coefficient μ s , reduced scattering coefficient μ ′ s and anisotropy factor g;
[0061] Among them, μ a is the probability of photon absorption per unit length, indicating the light energy lost due to absorption of photons per unit path. g is a dimensionless parameter that characterizes the unevenness of light distribution in tissue and the probability of forward scattering. Its value range is [-1, 1]. In this embodiment, g is set to 0.85. Since light is anisotropic during propagation, the reduced scattering coefficient is added to the optical characteristic parameters. Therefore, the reduced scattering coefficient μ is calculated using the following formula: ′ s :
[0062] μ ′ s =μ s (1-g)
[0063] When establishing a simulation system, input μ according to the material properties a With μ s In this embodiment, μ a Take 0.5cm -1 , μ s Take 1.0mm -1 .
[0064] Since the main absorption of light by fresh corn ears is water, the absorption coefficient μ can also be calculated using the following formula: a :
[0065] μ a =W f μ a.water
[0066] Where W f is the water concentration, μ a.water is the absorption coefficient of water.
[0067] In one embodiment, an elliptical Gaussian scattering model is used to model the photon scattering behavior in the kernels of the ear, and the cob of the ear is set to be fully absorbing and without a scattering medium.
[0068] The energy scattering distribution of the elliptical 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 azimuthal scattering angle in the cosine space direction, measured from the surface x-axis, σ x is the standard deviation of the Gaussian distribution parallel to the surface x-axis, σ y is the standard deviation of the Gaussian distribution parallel to the y-axis of the surface.
[0071] In one embodiment, a 3D model of a fresh corn ear and a detection system is performed using SolidWorks, and an optical simulation is performed using Lighttools software to simulate the photon transmission process in the fresh corn tissue. Figure 2 As shown in (a).
[0072] Step S120, the simulation system simulates the transmission process of photons in the fruit cluster at different detection distances and different light source angles using the Monte Carlo method, obtains the corresponding irradiance uniformity, and records the light distribution characteristics;
[0073] The light distribution characteristics include reflectivity and / or transmittance.
[0074] When a photon enters the tissue, each time it moves randomly one step, it will be partially absorbed and scattered due to collisions with corn tissue particles, causing the weight of the photon to gradually decrease.
[0075] The weight w of the photon is updated according to the following function:
[0076]
[0077] Where: μ a is the absorption coefficient of the tissue; μ s is the scattering coefficient of the tissue.
[0078] Step S130, obtaining the spectrum of the ear at different detection distances and light source angles through experiments, and calculating the corresponding spectrum surface area difference;
[0079] The method of obtaining the ear spectra at different detection distances and light source angles through experiments specifically includes:
[0080] Step S131, selecting N fresh corn ear samples, and dividing the middle section of the ear into M different collection point areas during a rotation period, and collecting a near-infrared spectrum at each collection point area;
[0081] In step S132, the surface of the middle section of the ear is used as the sampling area, and a circular rotation is performed along the central axis of the ear. The rotation angle is random each time, and each sample is rotated 360°. The spectra of fresh corn ears at different detection distances and light source angles are collected respectively, and then the average spectrum is obtained by calculating the average value of each spectrum. Each sample of each type of different configuration parameters is measured N times, and the average value of the N spectra is taken as the original spectrum of the sample, and an original spectrum sample set is generated.
[0082] Step S133: The fresh corn samples are divided by the SPXY method, and then the spectrum of the fresh corn sample is preprocessed using the standard normal variable transformation (SNV). Finally, the spectral information is associated with the measured moisture content and / or SSC values using the support vector machine (SVM) algorithm to establish a quantitative analysis and detection model for the intrinsic quality of fresh corn. SNV standardizes each spectral data itself, which can eliminate the independent variable dimension, as shown in the following formula:
[0083]
[0084] X is the original spectrum, is the mean value of each spectrum, and SD is the standard deviation of each spectrum.
[0085] Available through Figure 3 The device in the experiment performs the above steps S130 to S133.
[0086] The irradiance uniformity is used to evaluate the degree of uniform distribution of light on the receiving surface. Specifically, it measures the degree of fluctuation in light intensity and describes the uniformity of the distribution of light sources on the receiving surface. In applications that require precise light distribution, ensuring the consistency of light intensity is crucial to the effect. The higher the irradiance uniformity value, the more uniform the light is on the receiving surface, the smaller the standard deviation, and the smaller the difference in light intensity at each position on the receiving surface; conversely, the lower the irradiance uniformity value, the more uneven the light distribution on the receiving surface. The irradiance uniformity is the relative standard deviation of irradiance at different positions on the light outlet plane, and is calculated by the following formula:
[0087]
[0088] Among them, U is the irradiance uniformity, which indicates the uniformity of light intensity on the receiving surface; E i is the irradiance value at different locations; is the average value of irradiance at different locations; std(E i ) is the standard deviation of irradiance at different locations.
[0089] Step S140, determining the final detection distance and light source angle based on the analysis and judgment of the irradiance uniformity and the spectral surface difference;
[0090] The spectral surface area difference is the cumulative sum of the curve areas between the maximum and minimum absorbance values of each spectral point of a set of spectral curves, and is calculated by the following formula:
[0091]
[0092] Where SAD is the differential integrated absorbance; X i is the spectral value at each wavelength point; is the overall average spectrum value; N is the total number of wavelength points; X max,i is the absorbance of the highest spectrum at the i-th wavelength; X min,i is the absorbance of the lowest spectrum at the i-th wavelength; Δλ i is the distance between adjacent wavelengths.
[0093] In one embodiment, the relative error between the relative change rate of the spectral surface area difference and the relative change rate of the irradiance uniformity at 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 , predicting the intrinsic quality of the fresh corn ear by collecting the near-infrared spectrum of the ear according to the final detection distance and the light source angle.
[0095] The near-infrared spectrum of the fruit ears is collected, specifically comprising:
[0096] Step S151, selecting N fresh corn ear samples of the same variety and size as the experiment, and taking the middle section of each sample as the spectrum collection area;
[0097] In step S152, each sample rotates once, and within the rotation period, the middle section of the ear is divided into M different collection point areas, each collection point area collects n near-infrared spectra, and the average spectrum of the n near-infrared spectra collected in each collection point area is used as the original spectrum of the collection point area to form an original spectrum set.
[0098] Step S153: After collecting the spectrum of the ear, several kernels are peeled from the middle of each sample and divided into two groups, and the actual moisture content and the actual SSC value are measured respectively;
[0099] Step S154, removing abnormal data from the measured values of water content, and constructing a data set of measured values of water content; removing abnormal data from the measured values of SSC, and constructing a data set of measured values of SSC;
[0100] In one embodiment, abnormal data is removed using a Z-score algorithm.
[0101] In step S155 , the water content measured value dataset and the SSC measured value dataset are divided into a calibration set and a prediction set respectively by using the SPXY algorithm.
[0102] Step S156, pre-processing the original spectrum set through SG, modeling the moisture content of fresh corn fruits and vegetables through PLSR, and then detecting the moisture content of the ear through the SG-PLSR model;
[0103] Based on the SG-PLSR model, prediction models of the average spectra of the middle section of the ear at different collection points (number 1-M) were constructed. 2 , RMSEP and RPD, and select the final number of collection point areas.
[0104] Step S157, preprocessing the original spectrum set through SNV, extracting features from the original spectrum set through the CARS algorithm, modeling the SSC value of fresh corn fruits and vegetables through SVR, and then detecting the SSC value of the ear through the SNV-CARS-SVR model.
[0105] In one embodiment, the performance of the established model is evaluated by the correlation coefficient R2, the root mean square error RMSE, and the residual prediction deviation RPD, wherein the calculation formula of RPD is as follows:
[0106]
[0107] Embodiment 2 of the present invention provides a method for detecting the intrinsic quality of fresh corn ears, specifically a method for detecting the moisture content of the ears, comprising the following steps:
[0108] Step S201, as Figure 4 As shown in (c), 90 samples of the same species and size as the experiment were selected and divided into three equal segments, which were defined as the first segment, the middle segment, and the tail segment;
[0109] Step S202: Each sample is rotated 360°, and within the rotation period, each segment of the ear is divided into 6 different collection point areas. The middle section collection point is shown as follows: Figure 4 (c) shows the original waveform of the 6 acquisition points. Figure 4 As shown in (f), the average spectrum of different acquisition points is as follows: Figure 4 (e) shown.
[0110] Step S203: 18 spectra are collected for each ear, 540 spectra are collected for each segment of all samples, and a total of 1620 spectra are collected for the first, middle and last segments. The global original spectrum is as follows: Figure 4 (d) shown.
[0111] Step S204: After the spectrum acquisition is completed, the moisture content of the first section, the middle section and the tail section of the fresh corn ear is measured respectively.
[0112] Step S205, eliminating outliers using the Z-score method;
[0113] Step S206: dividing the water content measured value data set into a calibration set and a prediction set using the SPXY algorithm.
[0114] Step S207, preprocessing the spectral data through preprocessing methods such as no preprocessing NONE, standard normal variable transformation SNV, multivariate scatter correction MSC, first-order derivative 1D, second-order derivative 2D and convolution smoothing SG; and using PLSR to model the moisture content of fresh corn. When using PLSR to establish a correction model, in order to avoid underfitting or overfitting, the optimal number of latent variables LVs involved in the modeling is selected, and the LVs corresponding to the minimum value of the predicted residual sum of squares is the optimal number of principal components.
[0115] Step S208: Global modeling:
[0116] The NONE, SNV, MSC, SG, 1D and 2D pretreatment methods were combined with the PLSR model to establish a prediction model for the moisture content of fresh corn ears. As shown in Table 1, the global model of fresh corn ears under different pretreatments includes all regions, including the first section, middle section and tail section.
[0117] Table 1 Prediction results of the global model for moisture content of fresh corn ears
[0118]
[0119] The higher LVs in global modeling indicate that the global model is not adaptable enough to the data, the model structure is complex, and the generalization ability is weak.
[0120] Step S209: Establish prediction models for different parts:
[0121] To further improve the detection accuracy, local prediction models for different ear positions were established, as shown in Table 2;
[0122] Table 2 Prediction results of PLSR model under different preprocessing methods
[0123]
[0124] From Table 2, we can see that in the first segment modeling of the ear, the model accuracy after 1D preprocessing is the highest. The RMSEP and RPD were 0.937, 0.009 and 4.114 respectively, and the LVs was 9. In the modeling of the middle part of the ear, the model after SG smoothing preprocessing had the highest accuracy. The RMSEP and RPD were 0.955, 0.007 and 4.884 respectively, and the LVs was 8. In the modeling of the tail section of the ear, the model accuracy was the highest after 1D preprocessing. The RMSEP and RPD were 0.840, 0.001 and 2.579 respectively, and the LVs was 6. By comparing and analyzing the prediction results of the models, it was found that the modeling effect of the middle part of the ear was the best.
[0125] Step S210, respectively establishing prediction models for the first segment of the ear, the middle segment of the ear, and the tail segment of the ear, and cross-validating the models for different ear segments;
[0126] Table 3 Cross-validation of different ear segments
[0127]
[0128] As shown in Table 3, each segment model performed best when predicting the moisture content of its own segment, but the prediction results declined when predicting other segments. The average RMSEP of the three models for different ear segments was calculated, and the results were 0.0167, 0.014, and 0.0160, respectively. The results showed that the mid-segment prediction model had the lowest RMSEP for the first, middle, and last segments, indicating that the moisture content prediction model established for the mid-segment has better generalization ability.
[0129] Step S211, establishing prediction models for different collection points, based on the SG-PLSR model; respectively constructing prediction models for the number-averaged spectra of the middle section of the ear at 6 different collection points, as shown in Table 4,
[0130] Table 4 Modeling results of the number of different collection points in the middle of the bunch
[0131]
[0132] When the number of sampling points increases to 5, the prediction accuracy of the model reaches the best. The RMSEP and RPD values were 0.967, 0.007, and 5.647, respectively.
[0133] This embodiment clarifies the near-infrared detection method for the moisture content of fresh corn ears, specifically including the sampling area, the method for determining the number of collection point areas, and the prediction model establishment process; the present invention can not only meet the static modeling experiment of the intrinsic quality of fresh corn ears, but can also be used for rapid online detection of the intrinsic quality of fresh corn ears, and deployed in the production line for real-time detection.
[0134] Example 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 the ear, comprising the following steps:
[0135] Step S301, selecting 140 samples of the same species and size as the experimental ones for testing;
[0136] Step S302, as Figure 5 As shown, the midsection 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 fluctuations. During each measurement, the corn sample was rotated 360° along the central axis of the ear, and six spectra were collected. The average of these six measurements was used as the original spectrum for that sample. In this experiment, a total of 140 samples were measured, 840 spectra were collected, and 140 original average spectral data sets were obtained.
[0137] Step S303, measuring the SSC value of each sample one by one by using a refractometer method;
[0138] Step S304, eliminating outliers using the Z-score method;
[0139] Step S305, dividing the SSC measured value data set 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 SGS, SNV, MSC, FD, and DT algorithms. Based on the full-band data, a prediction model for SSC of fresh corn was established using PLSR. The optimal number of latent variables (LVs) was determined using the minimum value of the cross-validation root mean square error (RMSECV) through ten-fold cross validation, as shown in Table 5.
[0142] Table 5 SSC full-band modeling results
[0143]
[0144] From Table 5, we can see that SNV preprocessing has the best effect. The spectra after MSC, SNV and FD preprocessing are shown in Figure 2. Figure 6 As shown in Figure 2, MSC and SNV pretreatments effectively eliminated the scattering effect caused by physical properties such as grain size and surface grooves, while FD pretreatment removed the baseline drift in the spectrum. Figure 6 (a) is the spectrum after SNV preprocessing, Figure 6 (b) is the spectrum after MSC pretreatment, Figure 6 (c) is the spectrum after FD preprocessing.
[0145] Step 307: Establish an SSC characteristic band prediction model:
[0146] To reduce the interference of non-target components on SSC prediction, characteristic wavelengths were 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 (SNV, MSC, and FD) with good preprocessing effects listed in Table 5 were selected. These methods were combined with characteristic wavelengths extracted by feature extraction algorithms such as CARS, SPA, and RF to establish SSC prediction models based on characteristic band spectral information.
[0147] Table 6 SSC characteristic band modeling results
[0148]
[0149] As shown in Table 6, the CARS, SPA, and RF variable selection algorithms significantly reduced the number of feature wavelengths required for modeling. Compared with the SNV preprocessing full-band modeling without feature extraction, the CARS, SPA, and RF algorithms performed better on the test set. The values reached 0.858, 0.808, and 0.831, respectively, which were 12.3%, 5.7%, and 8.7% higher than those of full-band modeling, indicating that characteristic band modeling not only reduces model complexity but also improves model prediction accuracy.
[0150] Analysis of the characteristic wavelength data extracted by different extraction algorithms shows that the number of characteristic wavelengths extracted by the RF, CARS, and SPA algorithms gradually decreases. The characteristic wavelengths extracted by the CARS and RF algorithms cover the 1149-1242nm and 1426-1483nm regions, respectively. These two regions contain important absorption peaks near 1200nm and 1450nm. In contrast, the characteristic wavelengths extracted by the SPA algorithm are primarily concentrated in the 1173-1263nm range.
[0151] Step S3071: The CARS algorithm selects a characteristic band:
[0152] Taking the data after SNV preprocessing 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, the resampling rate is 0.8, and the process of extracting feature parameters by CARS is as follows: Figure 7 As shown. Figure 7 (a) It can be seen that with the increase of the number of iterations, the number of screening variables is “from coarse to fine”, which effectively improves the efficiency of the algorithm and eliminates a large amount of useless spectral information. Figure 7 As shown in (b), a large amount of information irrelevant to the SSC of fresh corn was eliminated in the first 18 iterations, and RMSECV reached its lowest value at the 19th iteration. In the subsequent iterations, effective spectral information was eliminated and the RMSECV value began to rise. Figure 7 In (c), each curve represents the regression coefficient of each characteristic wavelength at different iteration numbers. The straight line in the figure indicates the sampling number corresponding to the minimum RMSECV value, which corresponds to the optimal characteristic wavelength set.
[0153] Step S3072: SPA algorithm selects characteristic bands:
[0154] When the correlation between wavelengths is strong, the SPA algorithm can effectively reduce redundant features. The process of SPA algorithm screening characteristic wavelengths is as follows: Figure 8 (a) When the number of characteristic wavelengths is selected as 24, the corresponding root mean square error RMSE is the lowest, which is 0.253. At this time, 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~1263nm. This absorption peak is mainly related to the secondary harmonic and summation absorption of the C-H bond. There are fewer characteristic wavelengths selected near the 1450nm absorption peak.
[0155] Step S3073: RF algorithm selects characteristic bands:
[0156] Taking the data after SNV preprocessing as an example, the selection threshold of the RF algorithm is set to 0.2. The probability of RF variable selection is as follows Figure 9As shown in the figure, the characteristic variables in the ranges 36-52, 55-67, 79-94, and 108-138 are more likely to be selected. These corresponding near-infrared spectral regions are 1140-1210 nm, 1222-1271 nm, 1320-1381 nm, and 1438-1561 nm. The characteristic wavelengths selected by this model only contain 34.3% of the original spectral variables, reducing the number of wavelengths while reducing redundant information and improving computational efficiency.
[0157] In the process of fresh corn SSC full-band modeling and characteristic band modeling, the SNV preprocessing method showed the best model prediction effect. Specifically, the training set of the best model using SNV preprocessing The test set is 0.869, the RMSEC is 0.219, and the The SNV preprocessing method has a significant advantage in processing near-infrared spectral data of fresh corn.
[0158] By comparing the accuracy of the characteristic band models using different preprocessing methods, we found that the CARS algorithm for feature extraction achieved higher prediction accuracy than the SPA and RF algorithms. Therefore, combining appropriate spectral preprocessing methods with characteristic wavelength extraction algorithms can accurately predict the SSC value of fresh corn ears.
[0159] Step S3084, comparing different characteristic band prediction models;
[0160] The data after spectral preprocessing and CARS characteristic band extraction were input into the SVR model and compared with the prediction results of the PLSR model. SVR uses the radial basis kernel function and uses the particle swarm optimization algorithm to optimize the penalty factor C and kernel parameter a of SVR. The algorithm parameters are set as follows: the population size is 30, the number of iterations is 50, and the value range of the hyperparameter to be optimized is [0.01, 100]. The prediction results are shown in Table 7. Comparing the data in Table 6 and Table 7, it can be seen that for MSC and SNV preprocessing, the SVR characteristic band model is slightly better than the PLSR characteristic band model. Among them, the "SNV-CARS-SVR" model has the best effect, and the training set is 0.881, RMSEC is 0.207, and the test set The prediction scatter plot of the characteristic band prediction model is as follows: Figure 10 As shown, Figure 10 (a)
[0161] Table 7 SVR algorithm modeling results
[0162]
[0163] The "SNV-CARS-SVR" model based on SVR is the best, and its test set The average sensitivity of the two samples was 0.869, the RMSEP was 0.185, and the RPD was 2.843.
[0164] This embodiment clarifies the near-infrared detection method of the SSC value of fresh corn ears, specifically including the method for selecting characteristic bands and the process for establishing a prediction model; the present invention can not only meet the requirements of static modeling experiments on the intrinsic quality of fresh corn ears, but can also be used for rapid online detection of the intrinsic 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, comprising: a bracket 1, a halogen lamp cup 2, and an optical fiber receiving head;
[0166] The bracket 1 includes: a concave bracket 11 and an inclined bracket 12. The inclined brackets 12 are symmetrically arranged at both ends of the bottom of the concave bracket 11. The inclined bracket 12 has no less than three fixing grooves, and a halogen lamp cup 2 is arranged in the fixing groove. A cylindrical platform 13 protruding outward is provided at the top of the concave bracket 11 corresponding to the center of the fixing groove. The cylindrical platform 13 has a movable groove in the longitudinal direction. The movable groove passes through the concave bracket 11 and the cylindrical platform 13. The optical fiber receiving head is arranged inside the movable groove.
[0167] An optical fiber receiving head corresponds to a pair of halogen lamp cups 2 on both sides, and jointly detects spectrum information of one position; the probe device can obtain spectrum information of no less than three positions at a time.
[0168] The central axis of the symmetrically arranged halogen lamp cup 2 has the same included angle as the central axis of the optical fiber receiving head. The optical fiber receiving head is used to receive the diffusely reflected light after the halogen lamp acts on the fruit cluster.
[0169] In a preferred embodiment, Figure 11 As shown, when the optimal light source angle determined by the simulation system is 45°, a probe device with a central axis of the halogen lamp cup 2 of 90° and an angle of 45° between the central axis of the optical fiber receiving head and the central axis of the halogen lamp cup 2 is used for detection. When the simulation system determines that the optimal light source angle is other angles, detection is performed by producing probe devices with other angles.
[0170] The probe device of this embodiment is mainly targeted at the shape of corn ears and can quickly detect spectral data of multiple regions.
[0171] In this embodiment, the corn ears are divided into three sections for detection, so the inclined bracket is provided with three fixing slots.
[0172] In another embodiment, if the corn ears are divided into four sections, four fixing slots are formed on the inclined bracket 12 .
[0173] Embodiment 5 of the present invention further provides a detection system, comprising: a power supply, a probe device, a near-infrared spectroscopy module, an edge computing module, and a display module;
[0174] The power supply provides 24V voltage for the system; the probe device realizes near-infrared light emission and diffuse reflection light reception, and the probe device is 3-4cm away from the material; 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 moisture content and soluble solids content prediction 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 rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered by the scope of protection of the claims of the present invention.
Claims
1. A method for detecting the intrinsic quality of fresh corn ears, characterized in that: The following steps are involved: Based on the physical characteristics, detection device and optical property parameters of fresh corn ears, a simulation system for near-infrared light propagation inside the ears was established. The simulation system uses the Monte Carlo method to simulate the transmission process of photons in the fruit cluster at different detection distances and different light source angles, and obtains the corresponding irradiance uniformity; The spectra of the fruit ears at different detection distances and light source angles were obtained through experiments, and the corresponding spectral surface deviations were calculated. Determine the final detection distance and light source angle based on the analysis and judgment of irradiance uniformity and spectral surface difference; Based on the final detection distance and light source angle, the intrinsic quality of fresh corn ears can be predicted by collecting the near-infrared spectrum of the ears.
2. The method for detecting the intrinsic quality of fresh corn ears according to claim 1, wherein: The optical characteristic parameters of the ear include: absorption coefficient μ a , scattering coefficient μ s , reduced scattering coefficient μ′ s and anisotropy factor g; Randomly input μ according to the properties of the fruit cluster a With μ s The value of the scattering coefficient μ s The reduced scattering coefficient μ′ is calculated by multiplying it with (1-g) s .
3. The method for detecting the intrinsic quality of fresh corn ears according to claim 1, wherein: The physical characteristics of the fruit ear at least include: fruit ear grains and fruit ear cobs; wherein, an elliptical Gaussian scattering model is used to model the photon scattering behavior in the fruit ear grains, and the fruit ear cobs are set to be fully absorbing and without scattering media.
4. The method for detecting the intrinsic quality of fresh corn ears according to claim 1, wherein: The analysis of irradiance uniformity and spectral surface difference to determine the final detection distance and light source angle specifically includes: Calculate the relative error between the relative change rate of the spectral surface area difference and the relative change rate of the irradiance uniformity at 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.
5. The method for detecting the intrinsic quality of fresh corn ears according to claim 1, wherein: The near-infrared spectrum of the fruit ears is collected, specifically comprising: Select N fresh corn ear samples of the same variety and size as the experiment, and use the middle section of each sample as the spectrum collection area; Each sample rotates once, and within the rotation cycle, the middle section of the ear is divided into M different collection point areas. N near-infrared spectra are collected in each collection point area. The average spectrum of the n near-infrared spectra collected in each collection point area is used as the original spectrum of the collection point area to form the original spectrum set.
6. The method for detecting the intrinsic quality of fresh corn ears according to claim 5, characterized in that: After collecting the spectra of the ear, several kernels were peeled from the middle of each sample and divided into two groups to measure the actual moisture content and SSC values respectively; Remove abnormal data from the measured values of moisture content and construct a dataset of measured values of moisture content; remove abnormal data from the measured values of SSC and construct a dataset of measured values of SSC; The SPXY algorithm is used to divide the moisture content measured value dataset and the SSC measured value dataset into a calibration set and a prediction set respectively.
7. The method for detecting the intrinsic quality of fresh corn ears according to claim 6, wherein: The original spectrum set was preprocessed by SG, the moisture content of fresh corn fruits and vegetables was modeled by PLSR, and the moisture content of the ear was detected by SG-PLSR model. Based on the SG-PLSR model, prediction models of the average spectrum of the middle section of the fruit cluster at different collection point numbers 1-M were constructed. The final number of collection point areas was selected by judging the size of R2, RMSEP and RPD.
8. The method for detecting the intrinsic quality of fresh corn ears according to claim 6, wherein: The original spectrum set was preprocessed by SNV, the features of the original spectrum set were extracted by CARS algorithm, the SSC value of fresh corn fruits and vegetables was modeled by SVR, and the SSC value of the ear was detected by SNV-CARS-SVR model.
9. A probe device, characterized in that: include: Bracket (1), halogen lamp cup (2), optical fiber receiving head; The bracket (1) comprises: a concave-shaped bracket (11) and an inclined bracket (12); the inclined brackets (12) are symmetrically arranged at both ends of the bottom of the concave-shaped bracket (11); the inclined bracket (12) is provided with no less than three fixing grooves; a halogen lamp cup (2) is provided in the fixing groove; a halogen lamp is inserted into the halogen lamp cup (2); a cylindrical platform (13) protruding outward is provided at the top of the concave-shaped bracket (11) at a position corresponding to the center of the fixing groove; the cylindrical platform (13) is provided with a movable groove in the longitudinal direction; the movable groove passes through the concave-shaped bracket (11) and the cylindrical platform (13); an optical fiber receiving head is provided inside the movable groove; An optical fiber receiving head corresponds to a pair of halogen lamp cups (2) on both sides, and jointly detects one position spectrum information; the probe device can obtain no less than three position spectrum information at a time.
10. The probe device according to claim 9, characterized in that: The central axis of the symmetrically arranged halogen lamp cup (2) has the same included angle as the central axis of the optical fiber receiving head, and the optical fiber receiving head is used to receive the diffusely reflected light after the halogen lamp acts on the fruit cluster.
Citation Information
Patent Citations
Near-infrared method for determining the constituents of lotus root.
CH708057A2
Diffuse spectrum data processing method, and modeling method, predicating method and processing apparatus thereof
CN105136690A
Fruit and vegetable quality analysis method and system based on frequency-domain near infrared spectrum detection technology
CN105891149A
Method for rapidly and nondestructively determining content of straight-chain starch of corn single-ear grains
CN106706554A
Photon transmission simulation-based apple hyperspectral quality detection method
CN109856064A
Cited By
Corn straw moisture in-situ detection method and device
CN121540657A