Agricultural product quality detection method and system

By using a near-infrared spectrometer to perform multi-plane spectral scanning and baseline correction, combined with cellulose spectral band recognition and a random forest algorithm model, the problem of inaccurate mold detection in traditional agricultural product quality testing was solved, and the accuracy and automation of early mold detection were achieved.

CN120468080BActive Publication Date: 2025-09-19YONGCHUN COUNTY AGRICULTURAL SCIENCE RESEARCH INSTITUTE (YONGCHUN COUNTY AGRICULTURAL INSPECTION CENTER YONGCHUN COUNTY CROP BREED FARM)
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510985355.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-17
Publication Date
2025-09-19
Estimated Expiration
2045-07-17

AI Technical Summary

Technical Problem

Traditional methods cannot accurately analyze the spectral information of mold, existing technologies cannot effectively solve the spectral information of mold, existing technologies cannot accurately analyze the pre-spectral information of mold, and traditional agricultural product quality detection methods cannot accurately analyze the pre-spectral information of mold, resulting in weak early quality detection capabilities.

Method used

Multi-plane spectral scanning is performed using a near-infrared spectrometer to carry out baseline correction and cellulose spectral band identification, deducing the peak intensity attenuation index, identifying abnormal spectral risk factors preceding mold, and constructing a random forest algorithm model for quality detection.

Benefits of technology

It improves the accuracy and early warning capabilities of mold detection, ensures the efficiency and accuracy of agricultural product quality management, and realizes the automation and intelligence of agricultural product quality testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120468080B_ABST
    Figure CN120468080B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of quality detection technology, and in particular to a method and system for detecting the quality of agricultural products. The method comprises the following steps: performing multi-plane spectral scanning of apples using a near-infrared spectrometer to obtain a reflectance spectrum and perform baseline correction; subsequently, analyzing the degree of mold in the apple flesh through cellulose spectral band identification and peak intensity attenuation index deduction; then, identifying pre-abnormal spectral risk factors based on the mold degree data, generating a pre-abnormal spectral risk factor for mold, and constructing a quality detection model by tracing the abnormal factors and the temporal evolution of the mold degree; finally, sending the detection model to a terminal to perform agricultural product quality detection. The present invention optimizes the quality detection technology to make it more accurate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of quality detection, and in particular to a method and system for detecting the quality of agricultural products. Background Art

[0002] In recent years, with the rapid development of spectroscopy technology, especially the widespread application of near-infrared spectroscopy in agriculture, agricultural product quality testing has gradually become automated and intelligent. Near-infrared spectroscopy utilizes the absorption and reflection characteristics of samples at specific wavelengths of light to non-destructively detect key quality indicators of agricultural products, such as internal composition, moisture content, sugar content, and acidity. It can also complete the testing of large batches of samples in a short period of time. Compared with traditional chemical analysis methods, near-infrared spectroscopy has the advantages of being non-destructive, reagent-free, and rapid, and has therefore garnered widespread attention in agricultural product quality assessment. However, one traditional agricultural product quality testing method suffers from the inability to accurately analyze the pre-spectral information of mold, resulting in a weak ability to detect mold in its early stages. Summary of the Invention

[0003] Based on this, it is necessary to provide a method and system for detecting the quality of agricultural products to solve at least one of the above technical problems.

[0004] To achieve the above object, a method for detecting the quality of agricultural products is provided, the method comprising the following steps:

[0005] Step S1: performing multi-plane spectral scanning on the apple using a near-infrared spectrometer to obtain a multi-plane apple reflectance spectrum; performing baseline correction on the multi-plane apple reflectance spectrum to obtain a multi-plane apple reflectance time-series correction spectrum;

[0006] Step S2: performing cellulose spectral band identification on the multi-plane apple reflectance time-series corrected spectrum, and then performing peak intensity attenuation index convergence trend deduction to obtain the band peak intensity attenuation convergence trend; analyzing the degree of apple pulp moldiness based on the band peak intensity attenuation convergence trend to obtain pulp moldiness degree analysis data;

[0007] Step S3: Based on the pulp mold degree analysis data, the multi-plane apple reflectance time series corrected spectrum is subjected to front abnormal spectrum risk factor identification to generate a mold front abnormal spectrum risk factor;

[0008] Step S4: Based on the risk factors of the abnormal spectrum preceding the mold, the pulp mold degree analysis data is traced back to the abnormal factor-mold degree time series evolution, thereby obtaining abnormal factor-mold degree traceability association data; a quality detection model is constructed for the abnormal factor-mold degree traceability association data using the random forest algorithm to obtain a pulp internal quality detection model, and the pulp internal quality detection model is sent to the terminal to perform agricultural product quality detection.

[0009] Preferably, step S1 includes the following steps:

[0010] Step S11: performing multi-plane spectral scanning on the apple using a near-infrared spectrometer to obtain a multi-plane apple reflectance spectrum;

[0011] Step S12: inserting time series labels into the multi-plane apple reflectance spectrum to generate a multi-plane apple reflectance time series label spectrum;

[0012] Step S13: performing baseline correction on the multi-plane apple reflectance time series tag spectrum to obtain a multi-plane apple reflectance time series correction spectrum.

[0013] Preferably, step S2 includes the following steps:

[0014] Step S21: performing cellulose spectrum band identification on the multi-plane apple reflectance time-series correction spectrum to obtain the multi-plane cellulose spectrum band;

[0015] Step S22: performing peak intensity attenuation index convergence trend deduction on the multi-plane cellulose spectrum band, thereby obtaining the band peak intensity attenuation convergence trend;

[0016] Step S23: inferring the internal mold content of the apple based on the attenuation convergence trend of the band peak intensity to obtain the internal mold content;

[0017] Step S24: analyzing the degree of moldiness of the apple pulp according to the attenuation convergence trend of the band peak intensity and the internal mold output content to obtain pulp moldiness degree analysis data.

[0018] Preferably, step S22 includes the following steps:

[0019] Step S221: performing asymmetric structure analysis of the peak shape variation of the multi-plane cellulose spectrum band to obtain the asymmetric structure of the peak shape variation;

[0020] Step S222: calculating the peak height to peak area broadening ratio of the multi-plane cellulose spectrum band according to the asymmetric structure of the peak shape change, thereby obtaining the peak height / peak area broadening ratio;

[0021] Step S223: calculating the peak shape band decay rate variance of the multi-plane cellulose spectrum band based on the peak height / peak area broadening ratio to obtain the peak shape band decay rate variance;

[0022] Step S224: Deducing the convergence trend of the peak intensity attenuation exponent according to the peak height / peak area attenuation ratio and the peak shape band decay rate variance, thereby obtaining the band peak intensity attenuation convergence trend.

[0023] Preferably, step S23 includes the following steps:

[0024] Step S231: deriving the cellulose chain breaking strength based on the band peak intensity attenuation convergence trend to obtain cellulose chain breaking strength data;

[0025] Step S232: performing an incremental regression analysis of hydrogen bond breakage between molecules based on the cellulose chain breakage strength data to generate incremental regression data of hydrogen bond breakage between molecules;

[0026] Step S233: performing an incremental time series exponential relationship prediction on the hydrogen bond breakage incremental regression data to obtain a hydrogen bond breakage incremental time series exponential relationship;

[0027] Step S234: mapping the cellulose degradation substrate concentration according to the hydrogen bond breakage increment time series exponential relationship to obtain the cellulose degradation substrate concentration;

[0028] Step S235: analyzing the periodic relationship of mold growth increment based on the hydrogen bond breakage increment time series exponential relationship and the cellulose degradation substrate concentration, thereby obtaining the periodic relationship of mold growth increment;

[0029] Step S236: inferring the internal mold output content of the apple based on the periodic relationship of mold reproduction increment to obtain the internal mold output content.

[0030] Preferably, step S24 includes the following steps:

[0031] Step S241: performing time series attenuation rate differential processing on the band peak intensity attenuation convergence trend to obtain intensity attenuation rate differential data;

[0032] Step S242: performing intercellular gap structure damage gradient fitting based on the intensity decay rate differential data to generate an intercellular gap structure damage gradient;

[0033] Step S243: performing a cell permeability increment index coupling process according to the cell gap structure damage gradient to obtain the cell permeability increment index of the inner pulp;

[0034] Step S244: performing water disorder entropy analysis based on the cell permeability increment index to obtain a water disorder entropy value;

[0035] Step S245: analyzing the degree of moldiness of the apple pulp according to the cell permeability increment index, the water disorder entropy value, and the internal mold output content to obtain pulp moldiness degree analysis data.

[0036] Preferably, step S3 includes the following steps:

[0037] Step S31: performing cluster analysis on the fruit pulp mold degree analysis data to obtain fruit pulp mold degree analysis cluster data;

[0038] Step S32: Based on the flesh mold degree analysis clustering data, the multi-plane apple reflectance time series corrected spectrum is subjected to front abnormal spectrum risk factor identification to generate a mold front abnormal spectrum risk factor.

[0039] Preferably, step S4 includes the following steps:

[0040] Step S41: performing logical learning on the abnormal spectrum risk factor before mildew to obtain an abnormal spectrum risk summary factor;

[0041] Step S42: performing abnormal factor-mold degree temporal evolution traceability correlation on the fruit pulp mold degree analysis data according to the abnormal spectrum risk induction factor, thereby obtaining abnormal factor-mold degree traceability correlation data;

[0042] Step S43: A quality detection model is constructed for the abnormal factor-mold degree traceability correlation data using a random forest algorithm to obtain a pulp internal quality detection model, and the pulp internal quality detection model is sent to the terminal to perform agricultural product quality detection.

[0043] Preferably, for performing the agricultural product quality detection method as described above, the agricultural product quality detection system comprises:

[0044] A baseline correction module is used to perform multi-plane spectral scanning on apples using a near-infrared spectrometer to obtain a multi-plane apple reflectance spectrum; and perform baseline correction on the multi-plane apple reflectance spectrum to obtain a multi-plane apple reflectance time-series correction spectrum;

[0045] The mold degree analysis module is used to identify the cellulose spectral bands of the multi-plane apple reflectance time-series corrected spectra, and then deduce the convergence trend of the peak intensity attenuation index to obtain the convergence trend of the peak intensity attenuation of the bands. The mold degree of the apple flesh is analyzed based on the convergence trend of the peak intensity attenuation of the bands to obtain the mold degree analysis data of the flesh.

[0046] An abnormal risk factor identification module is used to identify the pre-abnormal spectral risk factors of the multi-plane apple reflectance time-series corrected spectrum based on the pulp mold degree analysis data to generate the pre-abnormal spectral risk factors of mold;

[0047] The quality detection model construction module is used to perform traceability correlation between the abnormal factor and the mildew degree time series evolution of the fruit pulp mildew degree analysis data based on the mildew pre-abnormal spectral risk factor, thereby obtaining the abnormal factor and mildew degree traceability correlation data; the quality detection model is constructed for the abnormal factor and mildew degree traceability correlation data through the random forest algorithm to obtain the fruit pulp internal quality detection model, and the fruit pulp internal quality detection model is sent to the terminal to perform agricultural product quality detection.

[0048] The present invention provides the beneficial effect of multi-plane spectral scanning of apples using a near-infrared spectrometer, enabling comprehensive acquisition of reflectance spectral data from both the surface and interior of the apple. Multi-plane scanning improves detection accuracy and avoids errors caused by a single viewing angle. Furthermore, baseline correction processes the raw spectral data, eliminating interference caused by external factors (such as light source variations and equipment errors), resulting in more accurate data for subsequent analysis. This step lays the foundation for subsequent spectral data processing, ensuring the timing correction of the reflectance spectra, making the detection process more reliable and efficient. Cellulose spectral band identification on the time-corrected reflectance spectra of apples allows for precise extraction of characteristic band information associated with pulp mold. The content and distribution of cellulose in apple pulp are closely related to the degree of mold, and accurate identification of relevant bands helps infer the health of the pulp. Subsequently, deducing the convergence trend of the peak intensity decay index effectively reveals the mold progression of the pulp, providing data support for accurate analysis of the degree of mold. This process improves the accuracy of apple pulp quality analysis, making mold detection more scientific and reliable. By identifying abnormal spectral risk factors that indicate mold based on flesh mold severity analysis data, this step can detect quality issues early, even when apples are only slightly susceptible to mold, before they reach a critical stage. This early warning mechanism is crucial for agricultural product quality control. By identifying abnormal spectral risk factors, areas at risk of mold can be more accurately located, providing a scientific basis for subsequent quality control and risk assessment. Using a random forest algorithm, the data associated with abnormal factor and mold severity traceability is processed to construct an intelligent quality detection model. This model efficiently analyzes real-time spectral data and provides accurate mold severity prediction and quality detection. This approach not only improves detection accuracy but also makes the detection process more automated and intelligent, reducing the need for manual intervention. Once the model is delivered to the terminal, agricultural product quality can be monitored in real time, ensuring consumers receive high-quality apples that meet standards, significantly improving the efficiency and accuracy of agricultural product quality management. Furthermore, data analysis based on traceability correlations helps track quality trends. Therefore, the present invention is an optimization treatment of a traditional agricultural product quality detection method, which solves the problem that the traditional agricultural product quality detection method cannot accurately analyze the pre-spectral information of mold, thereby resulting in weak early quality detection ability of mold, improves the accuracy of the analysis of the pre-spectral information of mold, and improves the ability of early quality detection of mold. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 The figure is a flowchart of the steps of a method for detecting the quality of agricultural products;

[0050] Figure 2 for Figure 1 Detailed implementation steps of step S2 in FIG.

[0051] Figure 3 for Figure 1 Detailed implementation steps of step S3 in FIG. DETAILED DESCRIPTION

[0052] See also Figures 1 to 3 , a method for detecting the quality of agricultural products, the method comprising the following steps:

[0053] Step S1: performing multi-plane spectral scanning on the apple using a near-infrared spectrometer to obtain a multi-plane apple reflectance spectrum; performing baseline correction on the multi-plane apple reflectance spectrum to obtain a multi-plane apple reflectance time-series correction spectrum;

[0054] Step S2: performing cellulose spectral band identification on the multi-plane apple reflectance time-series corrected spectrum, and then performing peak intensity attenuation index convergence trend deduction to obtain the band peak intensity attenuation convergence trend; analyzing the degree of apple pulp moldiness based on the band peak intensity attenuation convergence trend to obtain pulp moldiness degree analysis data;

[0055] Step S3: Based on the pulp mold degree analysis data, the multi-plane apple reflectance time series corrected spectrum is subjected to front abnormal spectrum risk factor identification to generate a mold front abnormal spectrum risk factor;

[0056] Step S4: Based on the risk factors of the abnormal spectrum preceding the mold, the pulp mold degree analysis data is traced back to the abnormal factor-mold degree time series evolution, thereby obtaining abnormal factor-mold degree traceability association data; a quality detection model is constructed for the abnormal factor-mold degree traceability association data using the random forest algorithm to obtain a pulp internal quality detection model, and the pulp internal quality detection model is sent to the terminal to perform agricultural product quality detection.

[0057] In the embodiment of the present invention, reference Figure 1 The above is a schematic flow chart of the steps of a method for detecting the quality of agricultural products according to the present invention. In this example, the method for detecting the quality of agricultural products includes the following steps:

[0058] Step S1: performing multi-plane spectral scanning on the apple using a near-infrared spectrometer to obtain a multi-plane apple reflectance spectrum; performing baseline correction on the multi-plane apple reflectance spectrum to obtain a multi-plane apple reflectance time-series correction spectrum;

[0059] In an embodiment of the present invention, a near-infrared spectrometer with a wavelength range of 780 nm to 2500 nm is used to perform a six-sided, omnidirectional scan of a complete apple sample. During the scanning process, an equally spaced turntable is used to control the apple's rotation, enabling continuous reflection data acquisition within a 90-degree angle range in each of the X, Y, and Z directions. The scanning interval angle is precisely controlled to 15 degrees. Simultaneously, a linear array detector with an integration time of 200 ms is used to synchronously sample the reflection signal. When collecting raw spectral data, a reflection baseline is recorded using a black and white standard plate placed in a constant temperature environment. Baseline drift correction of the reflection curve is then performed using a first-order derivative denoising method combined with a Savitzky-Golay filter. The filter window width is set to 15 points, and the order of the fitting polynomial is set to 2. After completion of the above processing, the reflection spectra at each angle are reordered according to the sampling timestamps, and a standard time interval linear interpolation method is introduced to construct a unified time-series spectral vector sequence. The resulting data set is structured as a multidimensional matrix, where each dimension of the matrix corresponds to a sequence of spectral reflectance values ​​arranged in the order of scanning angle, wavelength point, and time tag.

[0060] Step S2: performing cellulose spectral band identification on the multi-plane apple reflectance time-series corrected spectrum, and then performing peak intensity attenuation index convergence trend deduction to obtain the band peak intensity attenuation convergence trend; analyzing the degree of apple pulp moldiness based on the band peak intensity attenuation convergence trend to obtain pulp moldiness degree analysis data;

[0061] In the embodiment of the present invention, first, based on the corrected multi-plane reflectance time-series spectral data, the target identification band range is set to 950nm to 1150nm, which is the characteristic absorption range of cellulose in plant cells. The spectral curve in this range is extracted and the standard Fourier transform method is used to identify the main frequency peak corresponding to the absorption band. Then, continuous wavelet transform is combined to perform peak enhancement processing, and the db4 basis in the Daubechies wavelet function family is used for five-layer decomposition. The approximate coefficient at the maximum scale is retained to enhance the main peak characteristics. Subsequently, polynomial regression is performed on the absorption intensity at the peak with time, and the fitting order is set to 3. The peak values ​​of each main peak band are calculated. The peak height change rate at different time points is calculated and the change trend of the second-order derivative of the logarithmic curve of its change rate is solved. If the convergence trend tends to negative growth and the change of the higher-order derivative is stable, it is considered that the band peak intensity attenuation converges. The sum of squares of the fitting residuals and the convergence fitting coefficient are recorded as analysis parameters. Then, according to the peak intensity attenuation rate of each band and the convergence trend stability index, the mold degree grade segmentation rule is established, and a five-level interval is set, where the first level indicates no mold, and increasing to the fifth level indicates severe mold. By comparing the normalized value of the attenuation index in different bands of each sample with the grade segmentation boundary, the quantitative analysis of the pulp mold degree is achieved, and the output result is the pulp mold degree sequence data with time series labels.

[0062] Step S3: Based on the pulp mold degree analysis data, the multi-plane apple reflectance time series corrected spectrum is subjected to front abnormal spectrum risk factor identification to generate a mold front abnormal spectrum risk factor;

[0063] In an embodiment of the present invention, the pulp mold degree analysis data obtained in step S2 is used as input, and the K-means clustering algorithm is used to perform multi-cluster cluster analysis on the analysis data within the entire sample range. The number of clusters is initially set to 6 categories, and the optimal number of clusters is determined to be 5 categories by the elbow rule. The Mahalanobis distance is used as the metric function during clustering, and the center point is randomly initialized 10 times to ensure clustering stability. After clustering is completed, the multi-plane apple reflectance time-series corrected spectral data corresponding to each cluster sample is extracted, and its mean, standard deviation, kurtosis and skewness characteristics in all bands are statistically analyzed. The local outlier factor (LOF) method is used to score the outlier degree of its reflectance curve in a specific band interval. The number of LOF neighbors is set to 20. By screening the spectra with a score higher than the set threshold of 1.8, they are marked as mold pre-abnormal spectral factors, and the band center point, corresponding time series position, average intensity and standard deviation of the factor are extracted as the final risk feature description value to form a pre-abnormal spectral risk factor set.

[0064] Step S4: Based on the risk factors of the abnormal spectrum preceding the mold, the pulp mold degree analysis data is traced back to the abnormal factor-mold degree time series evolution, thereby obtaining abnormal factor-mold degree traceability association data; a quality detection model is constructed for the abnormal factor-mold degree traceability association data using the random forest algorithm to obtain a pulp internal quality detection model, and the pulp internal quality detection model is sent to the terminal to perform agricultural product quality detection.

[0065] In an embodiment of the present invention, a one-to-one time series matching is performed between the mold pre-abnormal spectrum risk factor identified in step S3 and the pulp mold degree analysis data obtained by analyzing in step S2. A sliding window method with a time window length of 5 seconds is used to perform correlation analysis on the abnormal spectrum and the subsequent mold degree. A mold degree change trajectory of each abnormal factor at the subsequent five time points in the time series is constructed. At the same time, a logistic regression method is used to perform regression fitting on the occurrence probability of the abnormal factor at different mold levels. The regression input is the abnormal factor band center, peak amplitude and curvature change value, and the output is the probability distribution of five levels of mold degree. After 10-fold cross-validation, the abnormal factor-mold degree time series evolution traceability association data is obtained. After converting the data into feature vectors, the random forest method is used to construct an internal quality detection model. The number of trees in the forest is set to 200, the maximum depth of each tree is set to 10 layers, and the Gini index is used as the division criterion for splitting nodes. Finally, the mold level of the test sample is determined by model voting. After the model is trained, its parameters and structure are saved and deployed in the terminal detection equipment for performing real-time agricultural product quality detection tasks.

[0066] In another embodiment, a logical learning process is first performed on the abnormal spectral risk factors associated with mold growth. This learning process utilizes a decision tree algorithm, analyzing the correlation between the various characteristic attributes of the risk factors and the degree of mold growth to construct logical judgment rules. During the decision tree construction process, information gain is selected as the node splitting criterion. Information gain is calculated based on the distribution entropy of the risk factor characteristics, using a discretized form of the Shannon entropy formula. During the node splitting process, the characteristic attributes with the highest information gain are sequentially selected as the basis for splitting. The splitting threshold is determined by traversing all possible values ​​to determine the optimal split point. The decision tree is limited to a depth of ten layers, and the minimum number of leaf nodes is set to five to prevent overfitting. The result of the logical learning process is a series of judgment rules, each consisting of a conditional part describing the range of risk factor characteristics and a conclusion part providing the corresponding abnormal risk level. The abnormal spectral risk summary factor is derived through rule merging and optimization. During the merging process, redundant and conflicting rules are removed, retaining core rules with high coverage and good accuracy. The traceability association analysis of the temporal evolution of abnormal factors and mold degree is achieved through association rule mining, which uses a frequent itemset algorithm with a minimum support of 10% and a minimum confidence of 70%. During the association analysis, the abnormal factors and mold degree data are arranged in chronological order, and the association patterns within different time periods are analyzed using a sliding time window with a time window size of seven days and a sliding step size of one day. The traceability association data includes the occurrence time, duration, intensity changes of the abnormal factors, and the corresponding trend of mold degree changes. During the construction of the quality detection model of the random forest algorithm, the number of decision trees is set to 100, and the training samples of each decision tree are randomly selected from the original data using a sampling method with replacement, with a sampling ratio of 80%. The number of candidate features for each node is set to the square root of the total number of features, and the diversity of the model is ensured by randomly selecting candidate features.

[0067] Step S1 includes the following steps:

[0068] Step S11: performing multi-plane spectral scanning on the apple using a near-infrared spectrometer to obtain a multi-plane apple reflectance spectrum;

[0069] Step S12: inserting time series labels into the multi-plane apple reflectance spectrum to generate a multi-plane apple reflectance time series label spectrum;

[0070] Step S13: performing baseline correction on the multi-plane apple reflectance time series tag spectrum to obtain a multi-plane apple reflectance time series correction spectrum.

[0071] In the embodiment of the present invention, a near infrared spectrometer is selected, the acquisition wavelength range is controlled between 900nm and 2500nm, and the resolution is set to 4 The scanning mode adopts a transmission-reflection composite mode, and the sample fixing device is a six-axis rotating platform. The apple sample is aligned with the platform rotation axis with the center of the equatorial plane. The spectrum is collected every 15 degrees of the platform rotation. A 45-degree tilt angle is set in the three main viewing angle directions (top surface, equatorial plane, and bottom surface) for auxiliary surface scanning. A total of 72 spectral points are collected, and the platform rotation speed is constant at 2 revolutions per second. The spectrum integration time is set to 100ms each time. During the scanning process, the ambient temperature is maintained at 25 degrees Celsius and the humidity is 45%. The corresponding spectral intensity vector is recorded synchronously at each collection angle. The vector dimension is the number of original scanning wavelengths. A total of six groups of reflectance spectrum raw data are collected in combination with different planes to form a multi-plane apple reflectance spectrum data set. Each group of spectral data contains a complete reflection intensity vector and angle information label, and the spectral signal intensity range is uniformly normalized to between 0 and 1. First, according to the six sets of multi-plane apple reflectance spectrum data obtained in step S11, the sampling order in each set of data is time-coded, and a unified reference starting point is established on the time axis. The first sampling angle is used as the base time t0. A 10ms time tag is added to each subsequent angle sampling sequence. The sampling order index of the data record is strictly matched. The NumPy and Pandas libraries in Python are used to construct a three-dimensional array structure. The dimensions are time tag, wavelength point, and angle number, respectively. The original reflectance spectrum vector is used as the array element value. In this process, linear interpolation is used to continuously fill the time interval caused by angle switching. The specific interpolation operation uses the spectrum vectors of the previous and next time points as the reference. For each wavelength point, a linear difference is performed between the previous and next vectors to construct the missing spectrum points in the middle. After interpolation, the strict correspondence between the spectrum and the time tag is established. After the time tag is inserted, the spectrum data of each angle has a unified timestamp attribute in the three-dimensional array. The array size depends on the Cartesian product relationship between the total number of scanning angles, the number of wavelength points, and the sampling sequence length, forming a complete multi-plane apple reflectance time tag spectrum data structure.Based on the spectral data set after the insertion of the time series label in step S12, the reflectance spectrum curve corresponding to each time point is baseline corrected. First, the continuous wavelet transform method is used to pre-process the spectrum for denoising. The db6 wavelet basis function is used to perform three-layer decomposition to retain the approximate coefficients and remove the high-frequency noise coefficients. Then, the first-order derivative processing is performed on each denoised spectral curve to calculate its change slope, and the stable slope interval is identified as the spectral baseline area. The wavelength range of 1800nm ​​to 2000nm is selected as the reference baseline window. This interval is a weak water absorption area and the reflectance curve is stable. The least squares method is used. The linear trend of this area is fitted as the overall baseline model, and the entire spectral curve is subjected to difference shift processing to eliminate the influence of baseline drift. The kurtosis and skewness of the corrected spectrum are then statistically verified. If the kurtosis is less than 3 and the skewness is close to 0, the correction is considered complete. Otherwise, the baseline fitting process is returned to the process to readjust the fitting order. After all spectral data are corrected, the spectral sequence array is reconstructed in the time label dimension. Each spectrum is a reflectance time-series correction spectrum after unified baseline processing. The construction process of the multi-plane apple reflectance time-series correction spectrum is completed. The data format remains in the original three-dimensional matrix form and continues to be used for subsequent processing steps.

[0072] Step S2 includes the following steps:

[0073] Step S21: performing cellulose spectrum band identification on the multi-plane apple reflectance time-series correction spectrum to obtain the multi-plane cellulose spectrum band;

[0074] Step S22: performing peak intensity attenuation index convergence trend deduction on the multi-plane cellulose spectrum band, thereby obtaining the band peak intensity attenuation convergence trend;

[0075] Step S23: inferring the internal mold content of the apple based on the attenuation convergence trend of the band peak intensity to obtain the internal mold content;

[0076] Step S24: analyzing the degree of moldiness of the apple pulp according to the attenuation convergence trend of the band peak intensity and the internal mold output content to obtain pulp moldiness degree analysis data.

[0077] As an example of the present invention, refer to Figure 2 As shown, in this example, step S2 includes:

[0078] Step S21: performing cellulose spectrum band identification on the multi-plane apple reflectance time-series correction spectrum to obtain the multi-plane cellulose spectrum band;

[0079] In the embodiment of the present invention, based on the multi-plane apple reflectance time-series corrected spectral data obtained in step S13, the spectral segment with a wavelength range of 950nm to 1150nm in the reflectance spectrum is first extracted. This band is the characteristic absorption region of cellulose in the plant cell wall. The selection of this region is determined based on the distribution law of the position of the second harmonic absorption peak of cellulose in the literature. Then, a sliding window convolution method is used to extract all sub-segments in the interval with a step size of 5nm. The curvature change trend of each sub-segment is calculated using the first-order derivative, and the main absorption peak position is determined by identifying the obvious concave structure in the waveform curve. The central wavelength corresponding to the maximum reflectance decrease amplitude is found in each sub-segment as the local absorption peak center, and the Gaussian fitting method is further used to finely reconstruct the local peak shape of the absorption peak curve. The nonlinear least squares method is used for parameter optimization during the fitting process, and the fitting error tolerance is set to Finally, the characteristic bands of cellulose contained in the spectra of each angle at each time point are obtained, and a three-dimensional matrix structure is constructed to represent its wavelength center value, peak height, peak width and band boundary position. This matrix serves as the input data structure for subsequent attenuation analysis and constitutes a multi-plane cellulose spectral band dataset. This dataset uses the time dimension, angle dimension and wavelength dimension to form an index coordinate system, and each index position records the local absorption peak parameter information of the point.

[0080] Step S22: performing peak intensity attenuation index convergence trend deduction on the multi-plane cellulose spectrum band, thereby obtaining the band peak intensity attenuation convergence trend;

[0081] In the embodiment of the present invention, based on the multi-plane cellulose spectral band data set obtained in step S21, the absorption peak height value at each spectral angle and time point is tracked and extracted to construct a two-dimensional time series peak height matrix. The row dimension of the matrix corresponds to different scanning time points, and the column dimension corresponds to different scanning angles. This matrix is ​​used as input to perform exponential decay trend fitting processing. First, all peak height data are logarithmically transformed by log-transformation to reduce the nonlinear distribution offset. Then, the sliding regression window method is used to perform local exponential curve fitting with a window length of 5 time points. The sum of squares of the fitting residuals and the fitting coefficient are used to determine the decay stability of each window. Qualitative indicators, the attenuation index is defined as the negative logarithm of the fitting coefficient in each window, and the convergence trend is represented by the rate of change of the attenuation index between adjacent windows. If the rate of change tends to zero and the attenuation index is positive, it is considered to have a convergence trend. This judgment standard is uniformly applied to the time series peak height data of all angles and time points. The above method forms a complete band peak intensity attenuation convergence trend parameter matrix. The matrix structure contains the attenuation index, fitting coefficient, residual square value and convergence identification Boolean variable at each spectral angle and time point. In the data structure, all areas where the attenuation trend meets the convergence standard are aggregated, and their average attenuation index is extracted as the overall evaluation value to be input into the subsequent inference process.

[0082] Step S23: inferring the internal mold content of the apple based on the attenuation convergence trend of the band peak intensity to obtain the internal mold content;

[0083] In the embodiment of the present invention, the band peak intensity attenuation convergence trend parameter matrix extracted in step S22 is used to first aggregate the average attenuation index values ​​corresponding to each spectral angle and time period to form a one-dimensional angle mean sequence, and then the second-order difference is applied to the sequence to calculate the volatility index to eliminate the influence of short-term mutations. Then, the standardized Z-score normalization method is used to uniformly scale the attenuation index values ​​to the [-1,1] interval. The key to establishing a mapping relationship is to construct a quantitative relationship between the cellulose degradation process and fungal metabolites based on physical principles. Therefore, in this step, the logarithmic linear relationship between the endogenous aflatoxin B1, humic acid concentration and cellulose breakage rate in the apple mold process in the existing literature is used as the theoretical basis. In the data-driven Based on this, a linear regression analysis method was used to establish a statistical inference relationship between the attenuation index value and the total number of mold colony units (CFU / g) in the apple slices in the experiment. In the experiment, the colony forming units were counted after 48 hours of cultivation in a constant temperature incubator at 28 degrees Celsius. 300 sample slices were selected in the regression analysis, and the average attenuation index of each slice was fitted with the corresponding CFU value. After removing outlier samples with a deviation rate of more than 2% during the fitting process, the average slope parameter and standard error were obtained. Finally, a function mapping from the attenuation convergence trend to the mold output content was established. This mapping was used in the formal sample to predict the mold output content for each scanning angle in CFU / g, forming a multi-plane mold output spatial distribution vector as subsequent input.

[0084] Step S24: analyzing the degree of moldiness of the apple pulp according to the attenuation convergence trend of the band peak intensity and the internal mold output content to obtain pulp moldiness degree analysis data.

[0085] In an embodiment of the present invention, the attenuation trend parameter matrix in step S22 and the mold output content vector obtained in step S23 are used as dual input data sources. First, principal component analysis (PCA) is performed on the two variables of each scanning angle to extract the first principal component. The first principal component is used as the representative composite index of the angle. Then, the composite indexes of all angles are mean-synthesized to construct a pulp global mold impact index vector. Then, K-means clustering analysis is performed on the index vector to divide the mold degree into five level intervals. The number of clusters is set to K=5. The K-means++ algorithm is used for initialization, and the Euclidean distance is used as the distance metric. Each class in the clustering result corresponds to a mold level. The levels are sorted in ascending order by the mean mold output content and assigned labels from 1 to 5. After the clustering process is completed, the angle vectors of all samples are recalibrated to the corresponding mold level labels. Finally, a pulp mold degree analysis map is formed on the angle-time two-dimensional coordinate system. Each pixel point of the map contains a mold output concentration value and a mold level index value, forming a pulp mold degree analysis data structure for subsequent risk identification and analysis.

[0086] Step S22 includes the following steps:

[0087] Step S221: performing asymmetric structure analysis of the peak shape variation of the multi-plane cellulose spectrum band to obtain the asymmetric structure of the peak shape variation;

[0088] Step S222: calculating the peak height to peak area broadening ratio of the multi-plane cellulose spectrum band according to the asymmetric structure of the peak shape change, thereby obtaining the peak height / peak area broadening ratio;

[0089] Step S223: calculating the peak shape band decay rate variance of the multi-plane cellulose spectrum band based on the peak height / peak area broadening ratio to obtain the peak shape band decay rate variance;

[0090] Step S224: Deducing the convergence trend of the peak intensity attenuation exponent according to the peak height / peak area attenuation ratio and the peak shape band decay rate variance, thereby obtaining the band peak intensity attenuation convergence trend.

[0091] In the embodiment of the present invention, based on the multi-plane cellulose spectral band data extracted in step S21, first, continuous second-order derivative processing is performed on the reflectance curve of each group of bands. The derivative operation adopts a Savitzky-Golay filter, the window width is set to 11 wavelength points, and the polynomial order is set to 3. The minimum point in the second-order derivative curve is located to identify the center point of the absorption peak, and the wavelength coordinates and corresponding reflectance values ​​of the trough and peak on the left and right sides are recorded at the same time. Then, a symmetrical fitting curve is constructed with the peak center as the symmetry axis and the difference is compared with the true curve. The mean square error and the symmetrical residual rate of the difference are calculated as the asymmetric residual rate. Structural indicators, the constituent parameters of the asymmetric structure indicators include the ratio of the left half-width to the right half-width of the peak, the difference between the left shoulder slope and the right shoulder slope, and the difference between the left half-peak area and the right half-peak area. If at least two of the three indicators deviate from the ideal symmetrical structure by more than 20%, it is determined to be an asymmetric structure band. The analysis process is applied one by one to the spectral bands of all scanning angles and time points, and all band features marked as asymmetric structures are retained in the data structure, eventually forming a peak shape change asymmetric structure data set. Each item in the data set contains the peak center wavelength, left and right half-widths, symmetry error, asymmetric structure level label and its corresponding scanning angle and timing label. Using the asymmetric structure band data marked in step S221, the peak height value of each band is first extracted, which is defined as the difference between the minimum reflectivity value at the peak center wavelength and the maximum reflectivity at the left and right boundaries of the band. Then, the reflectivity curve within the corresponding band interval is integrated to obtain the reflection area of ​​the band. The integration method adopts the trapezoidal method numerical integration, and the integration interval is set to one integration point every 2 nm. The peak height and peak area are recorded in scalar form and then the ratio is calculated to obtain the peak height / peak area widening ratio. All ratios are normalized to be controlled in the range of 0 to 1. At the same time, to improve parameter stability, the comparison values ​​are smoothed by sliding windows, and the window width is set to 3 consecutive time points. The ratio changes at each time point and each scanning angle are recorded in the ratio matrix. Each record in the data structure contains the band center, peak height value, peak area value, ratio result and its position index in the time series. The ratio is used as an important parameter to measure the degree of peak expansion and is used in the subsequent calculation of peak shape change trend and reflect the response characteristics of cellulose absorption peak to attenuation.

[0092] The peak height / peak area widening ratio calculated in step S222 is used as an input parameter to construct a multidimensional widening ratio time series matrix. Each dimension of the matrix corresponds to the widening ratio at a scanning angle and time point. The matrix is ​​used as the basic data to perform the local change rate variance calculation operation. First, the first-order difference of the time series widening ratio at each scanning angle is calculated to obtain the widening ratio change rate vector. The standard deviation of this vector is calculated to obtain the change variance at each angle within a fixed time window. The window size is set to five consecutive time points, and the window sliding step is set to one time point. The calculation is repeatedly applied to all angle data, and the mean and variance change trends of the window at each time point are recorded in the variance sequence. At the same time, the time point where the standard deviation is more than twice the overall mean is extracted as the key position where the band morphology changes dramatically. Finally, the peak band decay rate variance data is obtained. The data structure includes the scanning angle, time label, widening ratio, first-order difference result, variance value and high fluctuation point identifier, which is used to subsequently determine whether it has entered the decay trend stage and measure the stability of the change process. Based on the peak height / peak area broadening ratio and the peak shape band decay rate variance obtained in step S222 and step S223, a composite feature vector is constructed as the analysis input. First, the ratio sequence and variance sequence under each scanning angle are selected for Pearson correlation analysis. The correlation coefficient threshold is set to be above 0.7 for significant correlation. If the condition is met, it is determined that the band has a decay trend characteristic. Secondly, an exponential trend fitting is performed on this type of band. The Log-linear model is used in the fitting formula, and the broadening ratio is used as the dependent variable and the time label is used as the independent variable to perform linear least squares fitting. The fitting slope value was extracted as the attenuation rate indicator, and the changing trend of this indicator was evaluated in the time series. If its first-order derivative was negative and there was no positive growth for three consecutive time points, it was determined to be a convergence trend area. Finally, the areas that met this condition for all scanning angles and time points were integrated, and their average attenuation slope, square value of fitting residual and peak shape stability parameter were extracted as the band peak intensity attenuation convergence trend characteristics. A three-dimensional convergence trend data structure was constructed, which included time labels, scanning angles, attenuation slopes, convergence status Boolean values ​​and fitting errors as the input basic data set for subsequent inference of mold content and mold degree.

[0093] Step S23 includes the following steps:

[0094] Step S231: deriving the cellulose chain breaking strength based on the band peak intensity attenuation convergence trend to obtain cellulose chain breaking strength data;

[0095] Step S232: performing an incremental regression analysis of hydrogen bond breakage between molecules based on the cellulose chain breakage strength data to generate incremental regression data of hydrogen bond breakage between molecules;

[0096] Step S233: performing an incremental time series exponential relationship prediction on the hydrogen bond breakage incremental regression data to obtain a hydrogen bond breakage incremental time series exponential relationship;

[0097] Step S234: mapping the cellulose degradation substrate concentration according to the hydrogen bond breakage increment time series exponential relationship to obtain the cellulose degradation substrate concentration;

[0098] Step S235: analyzing the periodic relationship of mold growth increment based on the hydrogen bond breakage increment time series exponential relationship and the cellulose degradation substrate concentration, thereby obtaining the periodic relationship of mold growth increment;

[0099] Step S236: inferring the internal mold output content of the apple based on the periodic relationship of mold reproduction increment to obtain the internal mold output content.

[0100] In an embodiment of the present invention, the band peak intensity attenuation convergence trend data obtained in step S224 is first used as an input data source. The data includes the attenuation slope, convergence Boolean value and peak shape stability index of each band in a continuous time series. In order to construct the cellulose chain breaking strength data, a mechanical deduction process is required based on the relationship between the spectral attenuation characteristics and the cellulose molecular structure. In this process, the absolute value of the band attenuation slope is used as a reference indicator for energy dissipation. It is assumed that when the cellulose main chain undergoes segmented degradation under acidification or oxidation conditions, the interatomic bond length thereof undergoes stretching changes, and the stretching process is positively correlated with the absorption intensity attenuation. Therefore, the average attenuation slope value of each spectral time point is used as a benchmark. Under the condition that the standard bond energy of the molecular main chain is known to be 305 kJ / mol, an energy proportional factor is introduced to map the spectral attenuation value to the degree of mechanical energy attenuation corresponding to the stretching of unit bond length per unit time. Subsequently, the Gibbs free energy change is introduced to approximately estimate the external energy required for fracture, and an energy conversion coefficient is introduced. As a conversion factor, the spectral slope is converted into the corresponding microscopic fracture energy using this conversion factor, and finally a numerical sequence of cellulose chain fracture strength is constructed. Each numerical unit in the sequence is kJ / mol, corresponding to the attenuation trend of each scanning angle and time point, forming a three-dimensional data structure, including time point, angle index and fracture strength value fields, which serve as the input basis for the next step of hydrogen bond change regression analysis. The cellulose chain fracture strength data obtained in step S231 is used as the input variable to construct an intermolecular hydrogen bond fracture incremental regression model. First, based on the typical hydrogen bond connection characteristics within the cellulose molecule, its average hydrogen bond binding energy is 21kJ / mol. It exists in the form of microscopic polypeptide structure aggregation in apple cells, which will cause local tension changes in the aggregation area during the fracture process. Therefore, the ratio of the fracture strength value to the 21kJ / mol baseline value is used as the relative tension coefficient of hydrogen bond fracture. A set of regression sample data is constructed with fracture strength as the independent variable and the number of hydrogen bond fracture events as the dependent variable. The dependent variable is calibrated indirectly, that is, in the actual experiment, deuterated water labeling NMR technology is used to detect the number of deuterium protons released after fracture as a representative indicator of fracture events. , spectral data of different attenuation stages were extracted from a total of 112 apple tissue samples and matched with the fracture intensity values. The corresponding deuterium signal area value was calibrated at each fracture intensity value and normalized, thereby constructing 112 sets of input-output pairs. Subsequently, the least squares regression algorithm was used for parameter fitting. During the fitting process, the sum of squared residuals was set to be less than 5% as the convergence threshold. Through iteration, the linear mapping parameter set between fracture intensity and hydrogen bond breakage increment was finally obtained. This mapping is used to infer the change in the number of hydrogen bond breakage events at any time point and angular position. The constructed hydrogen bond breakage increment regression data set contains fracture intensity values, regression predicted hydrogen bond breakage numbers, fitting residual values, angle labels and time indexes, forming a five-dimensional structure data body.The hydrogen bond breakage increment regression dataset established in step S232 is used as input. A complete time series hydrogen bond breakage change curve is constructed for each scanning angle in the dataset. The curve consists of the number of hydrogen bond breaks predicted by regression, and its time interval is equal to the time interval of the original spectrum scan, 10ms. An exponential function fitting operation is performed on the breakage number curve to establish an exponential relationship of its growth trend. The fitting adopts the exponential weighted moving average method, and the smoothing parameter is set to 0.25 to suppress short-cycle high-frequency fluctuations. The growth rate of each time point is recorded during the fitting process, that is, the ratio of the number of breaks between the previous and next time points. The first-order derivative of the growth rate sequence is calculated and the variance statistics are performed. If it is within the stable interval, When the first-order derivative of the growth rate approaches zero, the exponential relationship is considered to have reached a stable period. Conversely, if the continuous growth exceeds five time points and the first-order derivative of the growth rate is always greater than the positive threshold of 0.03, it is considered to be an exponential acceleration period. Each curve is divided into four segments according to the above criteria: initial period, acceleration period, stable period, and saturation period. The start and end time indexes, growth slope value, and average number of fractures of each segment are recorded. This segmentation information and the number of fracture events constitute a hydrogen bond fracture increment time series exponential relationship data structure. This structure uses the scanning angle as the first-level index and the time period as the second-level index. Each data unit contains the segment category label, growth rate, mean and variance of the fracture number, which is used to provide time-series hydrogen bond fracture evolution input information for the subsequent construction of the mold proliferation cycle association mechanism.

[0101] The hydrogen bond breakage increment time series index relationship data constructed in step S233 is used as the input basis. The data contains stage information such as the growth period, acceleration period, and stable period divided by time periods, as well as the hydrogen bond breakage growth rate and the mean number of breaks in each stage. In order to realize the cellulose degradation substrate concentration mapping operation, the corresponding degradation product release rate approximate function is established based on the molecular level microstructure changes represented by the number of breaks. In the experimental design, three apple tissue types corresponding to samples at different maturity stages are selected. The degradation substrate content mainly composed of β-D-glucose is extracted from the cellulose degradation liquid through in vitro extraction experiments. The changes in the glucose peak area under different breakage conditions in each tissue are detected by high performance liquid chromatography, where the detection wavelength is set to The chromatographic analysis was performed at 254 nm with a mobile phase ratio of water:acetonitrile = 85:15 at a flow rate of 1.0 mL / min. 2 μL of sample was taken each time and repeated three times to obtain the average peak area. A one-to-one mapping table was constructed based on the correspondence between the chromatographic peak area and the number of hydrogen bond breaks. A continuous mapping curve was constructed using cubic spline interpolation. This curve took the number of breaks as input and output the corresponding substrate concentration. The mapping curves of all samples were standardized to form a unified mapping function. The number of breaks at all angles and time points was then mapped to obtain the substrate concentration value in micromoles per milliliter. Finally, a four-dimensional data structure containing time index, scanning angle, break growth segment type, and substrate concentration was constructed for subsequent periodic pattern identification.The cellulose degradation substrate concentration data constructed in step S234 and the hydrogen bond breakage increment time series index relationship data formed in step S233 are integrated. First, the growth segment, acceleration segment and stable segment in each time series are used as the basis for analysis period division. A state transition sequence with period segments as units is established. The substrate concentration change rate and the breakage number growth rate in each period segment are vectorized to construct a two-dimensional state matrix. The row vector of the matrix is ​​the first-order difference of the substrate concentration per unit time, and the column vector is the breakage number growth rate difference. The state matrix is ​​subjected to fast Fourier transform analysis to extract its frequency domain energy distribution, wherein the number of transformation points is set to 128 points. The main energy frequency in the transformation result is extracted and located in the fluctuation range between 0.06 Hz and 0.12 Hz as the potential periodicity. The signal is further verified by autocorrelation analysis to see if there is a repetitive pattern in the periodicity. The minimum period window is set to 8 time points. If the periodic signal appears in more than three period segments and the correlation coefficient exceeds 0.85, it is marked as a valid periodic segment. The period segment label, frequency domain main frequency value, period length, and concentration-fracture coupling growth rate are recorded in the periodic relationship data set. At the same time, the ratio of concentration growth amplitude to fracture synchronization is calculated for each valid period segment. The ratio is defined as the standard deviation of the ratio of concentration growth value to fracture growth value. If the standard deviation is lower than 0.1, it is considered to have strong synchronization. Finally, the mold reproduction increment periodic relationship data is constructed. The data structure includes period sequence number, period length, frequency, concentration growth rate, fracture growth rate and synchronization index, which provides period-driven feature support for subsequent reproduction prediction.Based on the mold reproduction increment periodic relationship data obtained in step S235, the internal mold output content is inferred. In the specific inference process, the cycle length, concentration growth rate and fracture growth rate are first used as multivariate input parameters to construct an equally spaced inference window. The width of each inference window is set to 5 time points. The substrate concentration growth value in each cycle window is multiplied by the corresponding cycle synchronization index and multiplied by the cycle length coefficient to form a cumulative metabolic integral value. The integral value represents the degree of mold metabolic activity in the unit cycle. At the same time, a control group is set in the experiment to conduct a static culture experiment in an incubator, and the temperature is controlled at 25 degrees Celsius and the relative humidity is 90%. The apple sample is placed in this environment to collect mold quantity data, and the internal mycelium DNA content at different time points is detected by fluorescent quantitative PCR method. The internal Standardization was performed with reference to the gene Actin. Each cycle sample corresponded to an actual output content value, which was expressed as the gene copy number. A nonlinear inference function was established by regression analysis with the above-mentioned metabolic integral value. The function used a piecewise linear fitting method, and the segmentation was based on the concentration growth rate critical value of 0.015 and the cycle length critical value of 8 time points. Finally, based on the fitting function, the periodic relationship data under all scanning angles and time series were inferred, and the mold output data indexed by the time point was output, with the unit being the gene copy number per milligram of tissue. An internal mold output content data structure was constructed, which included the time index, cycle number, concentration-fracture integral value, and the deviation rate field of the inferred output content and the experimental control value. This structure was used to build the input data basis for the final grading of the degree of moldy pulp and the judgment logic association.

[0102] Step S24 includes the following steps:

[0103] Step S241: performing time series attenuation rate differential processing on the band peak intensity attenuation convergence trend to obtain intensity attenuation rate differential data;

[0104] Step S242: performing intercellular gap structure damage gradient fitting based on the intensity decay rate differential data to generate an intercellular gap structure damage gradient;

[0105] Step S243: performing a cell permeability increment index coupling process according to the cell gap structure damage gradient to obtain the cell permeability increment index of the inner pulp;

[0106] Step S244: performing water disorder entropy analysis based on the cell permeability increment index to obtain a water disorder entropy value;

[0107] Step S245: analyzing the degree of moldiness of the apple pulp according to the cell permeability increment index, the water disorder entropy value, and the internal mold output content to obtain pulp moldiness degree analysis data.

[0108] In the embodiment of the present invention, the band peak intensity attenuation convergence trend data constructed in step S224 is first subjected to time series attenuation rate differential processing. The trend data is based on a time series, wherein each time point contains the slope of the peak intensity value change of the corresponding spectral band. In order to obtain more accurate cellular tissue response information, the attenuation trend needs to be subjected to a first-order differential operation to extract the instantaneous change value of the intensity attenuation rate per unit time. In this processing process, the central difference method is used for differentiation, and the differential time interval Δt is set to 10ms. The differential operation formula is: the differential value at any time t is equal to t+1 and The difference between the attenuation slopes at two points is divided by 2×Δt. After completing the differential operation, a differential data matrix of the intensity attenuation rate at all time points at each scanning angle is obtained. This matrix records the dynamic trend gradient of the spectral signal intensity change, providing basic input features for subsequent tissue structure damage modeling. Each data point is in mAU / ms², representing the acceleration level of light intensity change. The intensity decay rate differential data obtained in step S241 is used as input, and the intercellular structure damage gradient is fitted in combination with the existing apple pulp microstructure reference atlas. First, a spatial structure mapping model is constructed. This model establishes a mapping relationship based on the statistical relationship between the actual intercellular damaged area in the tissue section sample and the differential characteristics of the near-infrared spectrum. In the actual experiment, 15 apple tissue areas with different degrees of decay were selected, and laser confocal microscopy was used to obtain intercellular structure gap images. After partitioning the images, the proportion of damaged areas was extracted and matched with the differential data. The least squares fitting function was used to calculate the fitting function parameters between the differential value change rate and the gap expansion gradient. Through this function, the differential data was mapped to the corresponding structural damage gradient value. The gradient value represents the decrease in the integrity of the intercellular structure per unit tissue area per unit time, and the unit is μm² / ms. The variance of the fitting coefficient is controlled within 0.07 to ensure prediction stability. After the mapping is completed, a cell intercellular structure damage gradient data matrix is ​​constructed. The matrix has time and angle as dual indexes, and the numerical field is the damage gradient value, which serves as the basis for subsequent permeability factor calculation. The intercellular structural damage gradient constructed in step S242 is used as the main variable data. The cell permeability increment index data is constructed through the physical relationship between the index and the cell wall permeability change factor. This index describes the changing trend of the widening of the material exchange channel due to damage to the cell structure in the fruit pulp. The specific implementation process is based on the apoplast fluid exchange simulation experiment. A specific fluorescent dye (FITC-labeled dextran) is injected into the fruit pulp tissue and the dye diffusion length per unit time is measured. A regression function is constructed based on the change in the dye diffusion rate and the change in the size of the intercellular space under the microscopic image. The corresponding relationship between the damage gradient and the diffusion rate is established. The structural damage gradient is converted into a permeability increment index through multiple regression. The basic permeability benchmark is set at 5.8 μm / min. In actual measurements, the permeability increment increases by 0.12 times the benchmark value for each unit increase in the gradient. Finally, a permeability increment index matrix is ​​constructed. The matrix unit is a dimensionless ratio, with the time point as the row index and the scanning angle as the column index. Each value represents the permeability increment value of the corresponding tissue area per unit time.The water disorder entropy value analysis is performed based on the cell permeability incremental index matrix constructed in step S243 as the input data. First, a window sliding operation is performed on the permeability index matrix in the time direction. The sliding window width is set to 5 time points and the step size is 1. The standard deviation and entropy value of the permeability index value in each sliding window are calculated. The entropy value calculation is based on the Shannon entropy definition. The permeability index value in each window is discretized and divided into 10 intervals. The probability p_i of each interval is calculated, and the entropy value is calculated based on p_i. The higher the entropy value, the more severe the permeability fluctuation in the corresponding time period, which is highly correlated with the instability of water flow inside the pulp. The entropy value unit is bit. A water disorder entropy value sequence matrix is ​​constructed. The matrix structure is the same as the permeability index matrix, which reflects the degree of water transport disorder in the time series in the pulp tissue. This indicator is one of the important signal sources for inferring the moldy grade of the pulp. The cell permeability increment index constructed in step S243, the moisture disorder entropy value constructed in step S244, and the internal mold output content constructed in step S236 are used as joint input factors to perform a comprehensive analysis operation on the degree of mold. First, the three types of data are aligned into a unified time-angle two-dimensional index system, and then the three types of data are normalized separately. The normalization range of the permeability index is 0 to 3, the range of the moisture entropy value is 0 to 1.8, and the range of the mold output content is 0 to. The copy number unit was used to construct a standardized indicator vector, and the mold grade score was calculated using a multi-indicator weighted method. The weight distribution was determined based on expert experience and the fitting results of the measured data. The permeability index weight was 0.4, the moisture entropy weight was 0.3, and the mold output content weight was 0.3. After the comprehensive score was calculated, the grades were divided into intervals, ranging from 0 to 5. Each level represented an increase of 0.2 times the unit of mold degree. Finally, the output was a data matrix for analyzing the mold degree of the pulp. The matrix was indexed by scanning angle and time point, and contained three fields: standardized input indicators, score values, and grade labels, providing a structured quantitative basis for subsequent cluster analysis and risk factor identification.

[0109] Step S3 includes the following steps:

[0110] Step S31: performing cluster analysis on the fruit pulp mold degree analysis data to obtain fruit pulp mold degree analysis cluster data;

[0111] Step S32: Based on the flesh mold degree analysis clustering data, the multi-plane apple reflectance time series corrected spectrum is subjected to front abnormal spectrum risk factor identification to generate a mold front abnormal spectrum risk factor.

[0112] As an example of the present invention, refer to Figure 3 As shown, in this example, step S3 includes:

[0113] Step S31: performing cluster analysis on the fruit pulp mold degree analysis data to obtain fruit pulp mold degree analysis cluster data;

[0114] In the embodiment of the present invention, an unsupervised cluster analysis operation is performed on the pulp mold degree analysis data matrix constructed in step S245. The matrix uses scanning angle and time point as a two-dimensional index structure and contains three main fields, namely, the standardized cell permeability increment index, the water disorder entropy value and the internal mold output content. In order to ensure the accuracy and physical rationality of the cluster analysis, the three types of indicators must first be Z-score standardized, and the standard distribution value of each indicator relative to its mean and standard deviation is calculated. After standardization, the data enters the cluster analysis process, and the K-means clustering algorithm is used for regional division, where the initial K value is set to 5. Based on the actual The five-level classification system of decay grades was matched in the experiment, and Euclidean distance was used as the similarity measure between samples. The maximum number of iterations was set to 300. In each iteration, all data points were reassigned to their categories and the cluster centers were updated. After clustering, the cluster label of each time-angle data point was output. The label represented the corresponding mold grade cluster. The clustering results were constructed into a mold degree parsing clustering data matrix, in which each element corresponded to the cluster classification number at a specific time and scanning angle. At the same time, the center vector was calculated for each category. The center vector was the mean vector of all samples in the category and was used for subsequent spectral feature mapping operations.

[0115] Step S32: Based on the flesh mold degree analysis clustering data, the multi-plane apple reflectance time series corrected spectrum is subjected to front abnormal spectrum risk factor identification to generate a mold front abnormal spectrum risk factor.

[0116] In the embodiment of the present invention, based on the clustering data of the degree of moldy flesh obtained in step S31, a time series mapping relationship between the moldy grade and the front spectral response is constructed. First, the multi-plane apple reflection time series correction spectrum obtained in step S13 is aligned with the clustering result according to time and scanning angle. Each spectrum corresponds to a cluster label. Then all spectra are grouped according to the cluster labels to construct a spectral cluster mapping set. Each group contains all spectral curve data belonging to the category. A difference feature mining operation is performed on each group of spectral data. All key absorption peak segments between 1100nm and 2500nm of each spectrum are selected, and the peak segment width is set to 30nm. The mean, standard deviation and peak position difference in each peak segment are calculated. The mutual information algorithm was used to calculate the information gain value between each band interval and the cluster label. The higher the information gain value, the stronger the band's ability to distinguish the mold grade. The information gain threshold was set to 0.35, and all band intervals that met this condition were screened as the candidate set of pre-abnormal spectral risk factors. The principal component contribution rate analysis method was further used to perform dimensionality reduction on these bands, and the factor components with a cumulative contribution rate of more than 85% were retained. Finally, a set of spectral segments that were highly correlated with the mold cluster label and their statistical feature vectors were constructed. This set of features is the pre-abnormal spectral risk factor for mold, which is a collection structure of several band intervals and their corresponding statistical feature types and numerical distributions. It is used in the subsequent input construction stage of mold evolution traceability analysis and quality detection model.

[0117] In another embodiment, in the specific implementation process of pre-processing abnormal spectral risk factor identification for multi-plane apple reflectance time-series corrected spectra based on flesh mold degree parsing cluster data, spectral data corresponding to the severe mold category and the serious mold category are first extracted from the flesh mold degree parsing cluster data as abnormal spectral reference benchmarks. The wavelength range of these spectral data is limited to between 900 nanometers and 1,700 nanometers, and the reflectivity value range is limited to between 0.1 and 0.9. The multi-plane apple reflectance time-series corrected spectra are then subjected to band segmentation processing. The spectral data of each band is compared point by point with the abnormal spectral reference benchmark, and the correlation coefficient of the spectral data of each band with the abnormal spectral reference benchmark is calculated. When the correlation coefficient is greater than 0.7, the band is marked as a high-risk band. The high-risk band is then subjected to abnormality quantification processing. By calculating the reflectivity standard deviation and peak offset of the high-risk band, the band with a standard deviation greater than 0.05 and a peak offset greater than 10 nanometers is determined as an abnormal risk band. Finally, the wavelength position, reflectivity characteristic value, anomaly degree score and time series label information of the abnormal risk band are integrated to generate the mold pre-abnormal spectral risk factor, which includes seven characteristic parameters: band start wavelength, band end wavelength, average reflectivity, maximum reflectivity, minimum reflectivity, reflectivity change rate and anomaly level.

[0118] Step S4 includes the following steps:

[0119] Step S41: performing logical learning on the abnormal spectrum risk factor before mildew to obtain an abnormal spectrum risk summary factor;

[0120] Step S42: performing abnormal factor-mold degree temporal evolution traceability correlation on the fruit pulp mold degree analysis data according to the abnormal spectrum risk induction factor, thereby obtaining abnormal factor-mold degree traceability correlation data;

[0121] Step S43: A quality detection model is constructed for the abnormal factor-mold degree traceability correlation data using a random forest algorithm to obtain a pulp internal quality detection model, and the pulp internal quality detection model is sent to the terminal to perform agricultural product quality detection.

[0122] In an embodiment of the present invention, first, based on the mold pre-abnormal spectral risk factor matrix obtained in step S32, the matrix contains multiple segments showing high information gain in the spectral band and their corresponding statistical parameters such as absorbance, peak height, and peak area. In order to construct an abnormal spectral risk factor structure that can be summarized and analyzed, a Boolean logic learning method is used to construct a joint logical expression between factors. This method uses a frequent item set mining algorithm to extract frequently co-occurring spectral feature combinations, sets the minimum support threshold to 0.12, and the minimum confidence to 0.65. For all spectral feature combinations that meet the threshold conditions, an AND-OR type logical expression tree structure is established, in which each branch represents a spectral risk combination path with a high correlation. The bands involved in each path and their characteristic attributes are standardized and encoded to form an abnormal spectral risk summary factor set. This set no longer depends on the original specific spectral curve data, but describes the complex relationship between multiple key band intervals in the form of a logical expression. This structure facilitates subsequent temporal structure coupling analysis with mold degree data. The abnormal spectral risk induction factor formed in step S41 is coupled with the pulp mold degree analysis data generated in step S24 in a multi-dimensional time series. First, the two types of data are matched one by one with the timestamp and scanning angle as the dual primary keys. Then, the spectral risk induction factor at each time point is used as the input feature, and the corresponding mold degree index is used as the target variable. The sliding time window structure is used to construct the evolution path mapping relationship between the abnormal factor and the mold degree. The time window width is set to 3 consecutive measurement cycles, and the sliding step size is set to 1 cycle. The abnormal factor change sequence in each time window and the change response of the target mold index are constructed. By calculating the abnormal factor change The time difference between the trigger frequency of the Boolean expression and the sudden increase of the mildew index is calculated to obtain the average trigger delay as the timing response offset. At the same time, dynamic time warping (DTW) distance is introduced to measure the morphological similarity between the two time series. The threshold is set to 0.4 to screen out factor-indicator pair combination structures with high evolutionary coupling. Finally, all verified factor-mildew timing coupling relationships are summarized to construct an abnormal factor-mildew degree traceability association data matrix. The matrix uses the abnormal factor expression number as the index item and its response offset, response frequency, and response intensity with the target indicator as fields to construct a multidimensional description structure, providing logically traceable data support for subsequent decision tree construction.The abnormal factor-mold degree traceability association data generated in step S42 is used as a training sample to construct a fruit pulp internal quality detection model, and the random forest algorithm is selected for the integrated decision tree construction operation. First, the sample set is divided into 70% training set and 30% validation set. In the training set, the number of sub-decision trees in the random forest is set to 100, the maximum depth is set to 8, the minimum number of samples for node splitting is 5, and the feature selection adopts the Gini coefficient minimization strategy. During the training process, a self-service sampling process with replacement is introduced for each subtree to enhance the generalization ability of the model. During the training of each subtree, only the subset features of the square root of the total number of features are used to improve the split diversity. After training, the validation set is predicted and the model accuracy, recall rate and F1 score are calculated through the confusion matrix to verify the stability of the model. The final structure of the model is integrated in the form of voting outputs of multiple sub-decision trees. Its input is the spectral risk factor expression number and its time-series traceability relationship characteristics, and its output is a discrete label value of the mold degree between 0 and 4. After the model is trained, the model parameter structure is saved in the central server and synchronously transmitted to the agricultural product testing terminal for on-site testing task deployment. During the actual deployment process, the model can output the corresponding mold grade label value of the flesh in real time by inputting the spectral risk expression structure of the new sample, thereby completing the quality grade classification task.

[0123] The present invention also provides an agricultural product quality detection system, which includes:

[0124] A baseline correction module is used to perform multi-plane spectral scanning on apples using a near-infrared spectrometer to obtain a multi-plane apple reflectance spectrum; and perform baseline correction on the multi-plane apple reflectance spectrum to obtain a multi-plane apple reflectance time-series correction spectrum;

[0125] The mold degree analysis module is used to identify the cellulose spectral bands of the multi-plane apple reflectance time-series corrected spectra, and then deduce the convergence trend of the peak intensity attenuation index to obtain the convergence trend of the peak intensity attenuation of the bands. The mold degree of the apple flesh is analyzed based on the convergence trend of the peak intensity attenuation of the bands to obtain the mold degree analysis data of the flesh.

[0126] An abnormal risk factor identification module is used to identify the pre-abnormal spectral risk factors of the multi-plane apple reflectance time-series corrected spectrum based on the pulp mold degree analysis data to generate the pre-abnormal spectral risk factors of mold;

[0127] The quality detection model construction module is used to perform traceability correlation between the abnormal factor and the mildew degree time series evolution of the fruit pulp mildew degree analysis data based on the mildew pre-abnormal spectral risk factor, thereby obtaining the abnormal factor and mildew degree traceability correlation data; the quality detection model is constructed for the abnormal factor and mildew degree traceability correlation data through the random forest algorithm to obtain the fruit pulp internal quality detection model, and the fruit pulp internal quality detection model is sent to the terminal to perform agricultural product quality detection.

[0128] The foregoing description is intended only to provide specific embodiments of the present invention, which will enable those skilled in the art to understand and implement the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention is not intended to be limited to the embodiments shown herein, but is to be construed in the widest possible manner consistent with the principles and novel features disclosed herein.

Claims

1. A method for detecting the quality of agricultural products, characterized in that: The following steps are involved: Step S1: performing multi-plane spectral scanning on the apple using a near-infrared spectrometer to obtain a multi-plane apple reflectance spectrum; performing baseline correction on the multi-plane apple reflectance spectrum to obtain a multi-plane apple reflectance time-series correction spectrum; Step S2: performing cellulose spectral band identification on the multi-plane apple reflectance time-series corrected spectrum, and then performing peak intensity attenuation index convergence trend deduction to obtain the band peak intensity attenuation convergence trend; analyzing the degree of apple pulp moldiness based on the band peak intensity attenuation convergence trend to obtain pulp moldiness degree analysis data; Step S3: Based on the pulp mold degree analysis data, the multi-plane apple reflectance time series corrected spectrum is subjected to front abnormal spectrum risk factor identification to generate a mold front abnormal spectrum risk factor; Step S4: Based on the abnormal spectral risk factor of the mold pre-existing abnormality, the pulp mold degree analysis data is traced back to the abnormal factor and the mold degree time series evolution, thereby obtaining abnormal factor and mold degree traceability association data; a quality detection model is constructed for the abnormal factor and mold degree traceability association data using a random forest algorithm to obtain a pulp internal quality detection model, and the pulp internal quality detection model is sent to the terminal to perform agricultural product quality detection; Step S2 includes the following steps: Step S21: performing cellulose spectrum band identification on the multi-plane apple reflectance time-series correction spectrum to obtain the multi-plane cellulose spectrum band; Step S22: performing peak intensity attenuation index convergence trend deduction on the multi-plane cellulose spectrum band, thereby obtaining the band peak intensity attenuation convergence trend; Step S23: inferring the internal mold content of the apple based on the attenuation convergence trend of the band peak intensity to obtain the internal mold content; Step S24: analyzing the degree of moldiness of apple pulp according to the attenuation convergence trend of the band peak intensity and the internal mold output content to obtain pulp moldiness degree analysis data; Step S22 includes the following steps: Step S221: performing asymmetric structure analysis of the peak shape variation of the multi-plane cellulose spectrum band to obtain the asymmetric structure of the peak shape variation; Step S222: calculating the peak height to peak area broadening ratio of the multi-plane cellulose spectrum band according to the asymmetric structure of the peak shape change, thereby obtaining the peak height / peak area broadening ratio; Step S223: calculating the peak shape band decay rate variance of the multi-plane cellulose spectrum band based on the peak height / peak area broadening ratio to obtain the peak shape band decay rate variance; Step S224: Deducing the convergence trend of the peak intensity attenuation exponent according to the peak height / peak area attenuation ratio and the peak shape band decay rate variance, thereby obtaining the band peak intensity attenuation convergence trend.

2. The agricultural product quality detection method according to claim 1, characterized in that: Step S1 includes the following steps: Step S11: performing multi-plane spectral scanning on the apple using a near-infrared spectrometer to obtain a multi-plane apple reflectance spectrum; Step S12: inserting time series labels into the multi-plane apple reflectance spectrum to generate a multi-plane apple reflectance time series label spectrum; Step S13: performing baseline correction on the multi-plane apple reflectance time series tag spectrum to obtain a multi-plane apple reflectance time series correction spectrum.

3. The agricultural product quality detection method according to claim 1, characterized in that: Step S23 includes the following steps: Step S231: deriving the cellulose chain breaking strength based on the band peak intensity attenuation convergence trend to obtain cellulose chain breaking strength data; Step S232: performing an incremental regression analysis of hydrogen bond breakage between molecules based on the cellulose chain breakage strength data to generate incremental regression data of hydrogen bond breakage between molecules; Step S233: performing an incremental time series exponential relationship prediction on the hydrogen bond breakage incremental regression data to obtain a hydrogen bond breakage incremental time series exponential relationship; Step S234: mapping the cellulose degradation substrate concentration according to the hydrogen bond breakage increment time series exponential relationship to obtain the cellulose degradation substrate concentration; Step S235: analyzing the periodic relationship of mold growth increment based on the hydrogen bond breakage increment time series exponential relationship and the cellulose degradation substrate concentration, thereby obtaining the periodic relationship of mold growth increment; Step S236: inferring the internal mold output content of the apple based on the periodic relationship of mold reproduction increment to obtain the internal mold output content.

4. The agricultural product quality detection method according to claim 1, characterized in that: Step S24 includes the following steps: Step S241: performing time series attenuation rate differential processing on the band peak intensity attenuation convergence trend to obtain intensity attenuation rate differential data; Step S242: performing intercellular gap structure damage gradient fitting based on the intensity decay rate differential data to generate an intercellular gap structure damage gradient; Step S243: performing a cell permeability increment index coupling process according to the cell gap structure damage gradient to obtain the cell permeability increment index of the inner pulp; Step S244: performing water disorder entropy analysis based on the cell permeability increment index to obtain a water disorder entropy value; Step S245: analyzing the degree of moldiness of the apple pulp according to the cell permeability increment index, the water disorder entropy value, and the internal mold output content to obtain pulp moldiness degree analysis data.

5. The agricultural product quality detection method according to claim 1, characterized in that: Step S3 includes the following steps: Step S31: performing cluster analysis on the fruit pulp mold degree analysis data to obtain fruit pulp mold degree analysis cluster data; Step S32: Based on the flesh mold degree analysis clustering data, the multi-plane apple reflectance time series corrected spectrum is subjected to front abnormal spectrum risk factor identification to generate a mold front abnormal spectrum risk factor.

6. The agricultural product quality detection method according to claim 1, characterized in that: Step S4 includes the following steps: Step S41: performing logical learning on the abnormal spectrum risk factor before mildew to obtain an abnormal spectrum risk summary factor; Step S42: performing abnormal factor-mold degree temporal evolution traceability correlation on the fruit pulp mold degree analysis data according to the abnormal spectrum risk induction factor, thereby obtaining abnormal factor-mold degree traceability correlation data; Step S43: A quality detection model is constructed for the abnormal factor-mold degree traceability correlation data using a random forest algorithm to obtain a pulp internal quality detection model, and the pulp internal quality detection model is sent to the terminal to perform agricultural product quality detection.

7. An agricultural product quality detection system, characterized in that: For executing the agricultural product quality detection method according to claim 1, the agricultural product quality detection system comprises: A baseline correction module is used to perform multi-plane spectral scanning on apples using a near-infrared spectrometer to obtain a multi-plane apple reflectance spectrum; and perform baseline correction on the multi-plane apple reflectance spectrum to obtain a multi-plane apple reflectance time-series correction spectrum; The mold degree analysis module is used to identify the cellulose spectral bands of the multi-plane apple reflectance time-series corrected spectra, and then deduce the convergence trend of the peak intensity attenuation index to obtain the convergence trend of the peak intensity attenuation of the bands. The mold degree of the apple flesh is analyzed based on the convergence trend of the peak intensity attenuation of the bands to obtain the mold degree analysis data of the flesh. An abnormal risk factor identification module is used to identify the pre-abnormal spectral risk factors of the multi-plane apple reflectance time-series corrected spectrum based on the pulp mold degree analysis data to generate the pre-abnormal spectral risk factors of mold; The quality detection model construction module is used to perform traceability correlation between the abnormal factor and the mildew degree time series evolution of the fruit pulp mildew degree analysis data based on the mildew pre-abnormal spectral risk factor, thereby obtaining the abnormal factor and mildew degree traceability correlation data; the quality detection model is constructed for the abnormal factor and mildew degree traceability correlation data through the random forest algorithm to obtain the fruit pulp internal quality detection model, and the fruit pulp internal quality detection model is sent to the terminal to perform agricultural product quality detection.

Citation Information

Patent Citations

  • Spectral imaging detection method of moldy peanut

    CN104914052A

  • Method for detecting mass content of component in polyolefin

    CN108254334A