Radish freshness detection method based on hyperspectrum

By using hyperspectral image processing and a multi-index fusion model, the problems of low efficiency and unstable accuracy in radish freshness detection in existing technologies have been solved, achieving rapid and accurate radish freshness assessment. It can automatically identify different tissue states and output independent freshness indices.

CN121789209APending Publication Date: 2026-04-03ZHEJIANG LINGJIAN SHUZHI TECH CO LTD +2
View PDF 0 Cites 1 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-31
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

Existing technologies for detecting the freshness of radishes suffer from low detection efficiency, unstable discrimination accuracy, and difficulty in fully capturing the spatial heterogeneity of the internal quality characteristics of the sample. In particular, it is difficult to identify the hidden pithiness phenomenon during post-harvest storage.

Method used

A hyperspectral-based method for detecting radish freshness was adopted. This method involves hyperspectral image acquisition, normal variable transformation, and weighted Savitzky-Golay filtering preprocessing. Combined with principal component analysis, independent component analysis, and nonnegative matrix factorization, physiological component factors were extracted. Finally, a multi-index fusion model was constructed to evaluate radish freshness using spectral K-Means clustering and spectral domain similarity measurement.

Benefits of technology

It enables rapid, accurate, and non-destructive assessment of radish freshness even without explicit post-harvest time labels, improving the stability and spatial accuracy of the detection. It can automatically identify different tissue states and output independent freshness indices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121789209A_ABST
    Figure CN121789209A_ABST
Patent Text Reader

Abstract

The invention discloses a radish freshness detection method based on hyperspectrums, and belongs to the field of radish detection, and the detection steps are as follows: S1: obtaining hyperspectrums of a plurality of contrast radishes of a currently detected radish to form a hyperspectral image of the currently detected radish; obtaining hyperspectrums of radishes of a plurality of detection standards in the database; s2, preprocessing the hyperspectral image obtained in the step S1 to obtain the spectral peak depth, the absorption peak displacement and the slope change of the hyperspectrum; s3, performing spectral decomposition on the hyperspectral features treated in the step S2 by adopting three decomposition methods, and extracting physiological component features related to the freshness of the radishes; s4, automatically identifying and outputting different tissue states of radishes through spectrum K-Means clustering and spectrum domain similarity measurement; and constructing a mathematical model of the freshness of the radish sample, and predicting the freshness of the to-be-detected radish by using the mathematical model. According to the method, the freshness index can be constructed by utilizing spectral physiological parameters under the condition that no clear post-harvest time label exists.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of radish detection, and more specifically, to a method for detecting the freshness of radishes based on hyperspectral imaging. Background Technology

[0002] With social development and the continuous improvement of people's living standards, modern consumers have increasingly higher requirements for vegetable quality. To effectively ensure food safety and meet the demand for high-quality consumption, agricultural research has conducted multi-dimensional explorations into vegetable quality testing technologies. Currently, the detection of vegetable quality parameters still relies mainly on chemical methods, primarily measuring the content of indicators such as chlorophyll, moisture, and soluble sugars. In contrast, spectroscopic technology, by analyzing the characteristic spectral information generated by the interaction between vegetables and light, can achieve efficient detection and evaluation of quality parameters. Leveraging the non-destructive testing advantages of spectroscopic technology, it can not only significantly improve detection efficiency and reduce testing costs, but also promote the large-scale application of the testing process.

[0003] Radishes, often called "earth ginseng," are beloved in China for their rich nutrition and sweet taste. However, post-harvest storage presents significant challenges: improper storage conditions can easily lead to frost damage, causing the fleshy roots to lignify and harden; more problematic is the development of hidden pithiness during storage—an internal quality deterioration that is difficult to accurately identify with traditional visual inspection alone. Existing detection technologies also have significant limitations: while near-infrared spectroscopy (NIRS) performs well in distinguishing moisture content and pithiness, the current method generally uses a single-probe (single-point) NIRS acquisition approach, which is easily affected by differences in sampling location and the randomness of probe contact, leading to two problems: firstly, reduced model generalization ability and unstable discrimination accuracy; secondly, difficulty in comprehensively capturing the spatial heterogeneity of sample internal quality. Furthermore, the single-point acquisition mode suffers from low detection efficiency, failing to meet the practical needs of online sorting and large-scale rapid screening.

[0004] Therefore, developing a technical method that can rapidly, accurately, non-destructively, and visually evaluate the freshness of radishes is of great theoretical and practical significance for improving the level of post-harvest processing of radishes, reducing losses, and protecting consumer rights. Summary of the Invention

[0005] To address the problems existing in the prior art, the purpose of this invention is to provide a method for detecting the freshness of radishes based on hyperspectral imaging, which can construct a freshness index using spectral physiological parameters even without a clear post-harvest time label.

[0006] To solve the above problems, the present invention adopts the following technical solution.

[0007] A method for detecting the freshness of radishes based on hyperspectral imaging includes the following steps: S1: Obtain the hyperspectral data of a currently detected radish and several comparison radishes to form a hyperspectral image of the currently detected radish; and obtain the hyperspectral data of several standard radishes from the database. S2: Perform normal variable transformation correction and weighted Savitzky-Golay filtering preprocessing on the hyperspectral image of the radish obtained in step S1 to obtain the changes in hyperspectral peak depth, absorption peak shift and spectral slope. S3: Principal component analysis, independent component analysis and non-negative matrix decomposition were used to perform spectral decomposition on the hyperspectral features after the processing in step S2, and physiological component factors reflecting the physiological state of radish samples were extracted. S4: Identify and output the tissue state of radish samples through spectral K-Means clustering and spectral domain similarity measurement; S5: Based on the data obtained from steps S2 and S4, construct the water decay model, the linear decay model of chlorophyll decay, the exponential decay model of sugar content, the regional partitioning stability model, and the spectral shape parameter stability model respectively, and then weight and fuse them to obtain the mathematical model of radish sample freshness. S6: Use the mathematical model obtained in step S5 to predict the freshness of the radish to be tested.

[0008] Furthermore, in S3, the physiological component factors are independent water factors, independent chlorophyll factors, and independent sugar factors.

[0009] Furthermore, in step S4, the spectral K-Means clustering process is as follows: A1: For any pixel in the spectral curve Constructing spectral feature vectors Using this feature vector as a benchmark, clustering is performed using spectral angular distance as the clustering distance; thus, the spectral feature vector is obtained. ; A2: Using spectral angular distance as the distance metric, the clustering objective function is obtained. M is the total number of pixels in the image; Let k be the set of pixels of class k. For the spectral center of class k, This represents the total number of clusters. A3: Iterate the clustering objective function obtained in step A2 using the K-Means model until the change in cluster centers is less than 10e. -6 This allows for the partitioning of radish samples.

[0010] Furthermore, spectral eigenvectors The construction is as follows: Step 1: Perform a standard normal transformation on each spectral curve using the standardization formula, which is as follows: ;in, For the i-th spectral curve at wavelength The reflectance value after SNV normalization; For the i-th spectral curve in The original reflectance value at that location; and , respectively, are the mean and standard deviation of the reflectance of all points on the i-th spectral curve; Step 2: Calculate the first derivative using the formula obtained in Step 1. Then it was combined with The spectral feature vector is obtained by splicing. : .

[0011] Furthermore, the iterative process of step A3 is as follows: (1) Initialize K cluster centers; (2) Assign each pixel to the most similar category based on SAM distance: Based on the spectral angular distance, each pixel is classified into the cluster most similar to its spectral features, thus completing the initial pixel classification; (3) Update the cluster centers based on the spectra of all pixels in the classification to obtain: ; (4) Repeat steps (2) and (3) until the change in cluster centers is less than 10e. -6 At this point, the algorithm is considered to have converged and the partitioning results are considered stable.

[0012] Furthermore, in step S5, the mathematical model for the freshness of the radish sample obtained by weighted fusion is as follows: , in, For moisture decay model; This is a linear decay model for chlorophyll decline; For regional partitioning stability models; For the stability model of spectral shape parameters; This is an exponential decay model for sugar content.

[0013] Furthermore, the moisture decay model is as follows: ,in ; This indicates the peak depth at 970 nm in the current spectrum; The reference peak depths for fresh radishes are: a=85, b=5, and k1=4.2. The linear decay model of chlorophyll decay is as follows ;in, ; This represents the change in the depth of the absorption peak at 680° in the current spectrum. These are relative time units; c=92; d=220; The exponential decay model of sugar content is as follows: ;in Sugar loss index ; This indicates the peak depth of the current spectrum at 550-600 nm; The reference peak depth indicates the fresh radish. =15, =6.

[0014] Furthermore, in the mathematical model for the freshness of radish samples obtained by weighted fusion, α is 0.45, β is 0.30, γ is 0.05, δ is 0.05, and ε is 0.15.

[0015] Furthermore, the regional partitioning stability model is as follows: ;in, , Let be the set of spectral clustering results for the t-th time series; Let T be the set of spectral clustering results for the (t-1)th time series, where T is the total number of time series and N is the total number of pixels. The mathematical model for the stability of the spectral shape parameter is as follows: ;in, ;in, Represents the empirical scale parameter; The Euclidean distance between two adjacent time steps is the shape parameter, and T is the total number of pixels.

[0016] Furthermore, step S6 also includes: after predicting the freshness of the radish to be tested, evaluating it according to the freshness grade of the radish sample.

[0017] Furthermore, the rating method for the freshness level of radish samples is as follows: a threshold segmentation method is adopted, by setting a first threshold T1 and a second threshold T2, and judging according to the value range of the comprehensive index F: when F is greater than or equal to T1, the radish sample is rated as fresh; when F is less than T1 but greater than or equal to T2, the radish sample is rated as slightly fresh; when F is less than T2, the radish sample is rated as not fresh.

[0018] Furthermore, T1 is 70 and T2 is 40.

[0019] Compared with the prior art, the advantages of this invention are: I. This invention can construct a freshness index for radishes using spectral parameters in the absence of a clear post-harvest time label, which can reflect the decline of radish water content, chlorophyll, and soluble sugar.

[0020] Second, this invention uses a multi-index fusion model to enhance prediction stability, reduce the impact of single factor fluctuations on the results, and can be directly combined with adaptive regional partitioning results to output an independent freshness index for each type of region, thereby improving spatial accuracy.

[0021] Third, this invention proposes an adaptive partitioning method for radish tissue regions that automatically divides them based entirely on spectral features without requiring manual pre-setting of regions. This method uses the hyperspectral reflectance curve of each pixel, along with spectral K-Means clustering and spectral domain similarity measurement, to automatically identify and output different tissue states of the radish, including the skin, flesh, aging tissue, and drying areas. Attached Figure Description

[0022] Figure 1 This is a flowchart of Example 1; Figure 2 This is a schematic diagram of the spectrum of the initial sample in Example 1. Detailed Implementation

[0023] Example 1:

[0024] Please see Figure 1 The present invention provides a flowchart of a method for detecting the freshness of radishes based on hyperspectral imaging, which includes the following steps: Step 1: Acquire hyperspectral images of radish samples under different storage conditions, and preprocess the obtained hyperspectral images using spectral normalization and weighted Savitzky-Golay filtering. Then, extract the shape parameters of the spectrum, and calculate the spectral peak depth, absorption peak shift, and spectral slope change. The specific method is shown below: After storage, hyperspectral images of vegetable samples were collected at equal time intervals; six time intervals were recorded, each lasting five days. The corresponding hyperspectral wavelength range was 389.09-1008.26 nm; the number of bands was 304. The spectral reflectance of the samples at the initial stage of storage is as follows: Figure 2 As shown. During the acquisition of hyperspectral images, chemical detection methods were used to simultaneously measure the content of chlorophyll, soluble sugar, and moisture in the radish samples.

[0025] The spectra were then normalized: Standard Normal Variable Transform (SNV) was used to correct the obtained spectra, removing multiplicative effects and additive baseline shifts caused by surface scattering, optical path differences, etc., while preserving chemical characteristics (absorption peak height / area). Weighted SG filtering is applied to the normalized spectrum: The corrected spectrum is processed using a weighted Savitzky-Golay filter, and higher weights are assigned to regions where the first derivative is zero and the absolute value of the second derivative is the largest. The weights are calculated based on the absolute value of the second derivative and normalized to [0.1-5.0] within the range of 5%-95%.

[0026] Finally, the spectral shape parameters of the weighted region are extracted, and the changes in spectral peak depth, absorption peak shift, and spectral slope are calculated. The specific operations are as follows: (1) Absorption peak depth: Using fresh spectral curve data as the baseline, the peak depths of the corresponding spectra at different time intervals are statistically analyzed. The calculation process is as follows: ; Where i represents the timing sequence, and its value is 0, 1, 2, ... 5; For wavelength, Let represent the depth of the absorption peak at the i-th time step; The reflectance at the initial corresponding absorption peak wavelength position; This represents the reflectance value at the same absorption peak wavelength position during the i-th time series.

[0027] (2) Absorption peak shift: This measures how the position of the absorption peak (spectral valley) changes with storage time. The calculation process is as follows: ; in, This represents the displacement of the absorption peak position from the initial time to the i-th time step, in cm. -1 ; This indicates the position of the absorption peak at the initial time (i=0), in cm. -1 ; This indicates the position of the absorption peak at the i-th time step, in cm. -1 .

[0028] (3) Slope change: Calculate the slope change of the weighted region within a specific spectral range.

[0029] For a certain weighted region, within a given band interval [ Within the range, least squares linear fitting is used to calculate the slope of reflectivity as a function of wavelength, and the change of this slope relative to the initial time is analyzed.

[0030] Having already defined the "weighted region", we can conclude that: ; in, Represents the set of pixels within the weighted region; Indicates the region weight (derived from clustering or area percentage); Indicates the timing number; This represents the average reflectance of all pixels within the weighted region at the i-th time sequence. Indicates the i-th time sequence, pixel p at wavelength The reflectance value at that location.

[0031] (1) Determine the spectral range: To effectively capture the changes in key biochemical components during fruit ripening, three representative independent absorption characteristic bands were selected for analysis: independent water absorption characteristics (900–1000 nm), independent chlorophyll absorption characteristics (660–700 nm), and independent sugar content absorption characteristics (weak absorption at 420–520 nm).

[0032] (2) Perform a linear fit on this interval: In the interval Within, take all discrete band points: ; in, Let be the wavelength of the k-th band; The average reflectance at that wavelength is M, and M is the number of bands within the interval.

[0033] Then, least squares fitting is performed: ; in: ; in, Represents the spectral slope of the i-th time series; This represents the average wavelength within the selected interval; This represents the average reflectance within the interval.

[0034] (3) Definition of the change in slope: Using the initial fresh state of the fruit (i=0) as a baseline, the change in slope at any time i is defined. : ; in: This represents the spectral slope at the initial time (i=0); This represents the change in slope of the i-th time series compared to the initial state.

[0035] (4) Normalized slope change index: In order to integrate the slope change into the final Freshness Index, it is usually necessary to normalize it. The normalized slope change index Defined as:

[0036] in, This represents the smallest constant to prevent the denominator from being zero (usually taken as e). -6 (to avoid division by zero errors during calculations) The value range is approximately [0, +∞), and the larger the value, the more obvious the change in spectral morphology.

[0037] Step Two: Principal Component Analysis (PCA), Independent Component Analysis (ICA), and Non-negative Matrix Factorization (NMF) were used to perform three types of spectral decomposition on the hyperspectral features processed in Step One. This allowed for the extraction of physiological components related to radish freshness from the hyperspectral reflectance curve, enabling the construction of interpretable "moisture characteristic factors, chlorophyll factors, sugar content factors, and tissue decay factors." The specific steps are as follows: The spectral wavelength range is 389.09-1008.26 nm, comprising 304 wavelength points. The following will be presented in matrix format. (Where N represents the number of pixels involved in the analysis, and 304 represents the number of wavelength points (bands) in the spectrum of each pixel) represents the sample spectral matrix, where N is the number of pixels involved in the decomposition. Here, the spectral matrix is ​​the spectral reconstruction, the preprocessed data.

[0038] The specific processing method is as follows: I. Principal Component Analysis (PCA) PCA can effectively extract the variation characteristics of radish epidermis and flesh, including: enhanced reflectance of the epidermal cuticle, enhanced scattering due to increased intercellular spaces in the flesh, and overall spectral smoothing or intensity weakening caused by tissue decay. After PCA on the spectral matrix X, the cumulative contribution rate of the first three principal components reached 92.82%, indicating that it can fully represent most of the variation information in the spectral data, thus providing a reliable basis for dimensionality reduction in subsequent analysis.

[0039] The specific analysis process is as follows: (1) First, the obtained spectral matrix X is centered according to the following formula to obtain the centered spectral matrix. : ; in, This represents the column mean vector of the spectral matrix X. Let be the spectral reflectance vector of the i-th row, i.e., the i-th pixel, in the spectral data matrix X.

[0040] (2) Calculate the centered covariance matrix : ; in, for The transpose of .

[0041] (3) The covariance matrix obtained in step (2) Perform eigenvalue decomposition: ; in, This is the eigenvector matrix (each column represents a principal component direction); It is a diagonal matrix of eigenvalues, sorted by size; It is the transpose of the eigenvector matrix.

[0042] (4) Finally, the principal component scores are calculated using the following formula. : ; Based on the test results, the first three principal components were labeled as PC1, PC2 and PC3, respectively, and the relevant data are shown in Table 1.

[0043] Table 1. Data obtained after PCA on the samples

[0044] As shown in Table 1, PC1 is highly correlated with moisture content, PC2 is correlated with changes in tissue structure, and PC3 is most sensitive to changes in the 680 nm band in the early stages of decay.

[0045] II. Independent Component Analysis (ICA) This invention utilizes ICA to decompose mixed spectral signals into several independent absorption components, thereby extracting independent water absorption characteristics (900–1000 nm), independent chlorophyll absorption characteristics (660–700 nm), and independent sugar content absorption characteristics (weak absorption at 420–520 nm). These components can be directly used as "physiological state factors" that reflect the physiological state of the sample.

[0046] The specific processing method is as follows: Assuming a centered spectral matrix It is the result of a linear mixture of several independent components, and can be expressed by the following formula:

[0047] in: It is a mixed matrix; It is an independent component matrix, where each row represents an absorption fundamental spectrum.

[0048] The goal of ICA is to solve the unmixing matrix. , making .

[0049] The FastICA algorithm is then used to continuously update W by maximizing its non-Gaussianity until convergence, thus obtaining the optimal solution. The iterative formula is shown below: ; in, and These represent the unmixing matrices of the ICA algorithm at the (k+1)th and kth iterations, respectively; E[·] denotes the mathematical expectation operator; This indicates that the output of the nonlinear function g(·) is transposed. This indicates the transpose operation of the first derivative of the nonlinear function g(·).

[0050] Finally, substitute the calculated W into... Independent components were identified, with three main independent components: IC1, IC2, and IC3. The peak values ​​of IC1, IC2, and IC3 and their corresponding physiological meanings are shown in Table 2.

[0051] Table 2. Peak values ​​of major independent components and their corresponding physiological implications.

[0052] Table 2 and the test results show that the IC1 (independent moisture factor) is similar to the moisture content measured by chemical experiments. The correlation coefficient reached: ; IC2 (independent chlorophyll factor) and chlorophyll content measured by chemical experiments The correlation coefficient is: ; IC3 (independent sugar-containing factor) and soluble sugar content measured by chemical experiments The correlation coefficient is: .

[0053] These results demonstrate that ICA can effectively separate the absorption components of the spectrum and make each component clearly physiologically interpretable, thus enabling it to be used to quantitatively characterize the physiological changes of radishes during postharvest storage.

[0054] III. Nonnegative Matrix Factorization (NMF) Nonnegative matrix factorization (NMF) aims to decompose the spectral matrix into a set of "absorption base spectra" with practical physical meaning, along with weighting coefficients for each base spectrum. These weighting coefficients directly reflect the relative content of physiological components such as water, chlorophyll, and sugar in the sample. Since spectral reflectance is nonnegative, the decomposition results of NMF are more consistent with the physical mechanism of optical absorption.

[0055] The specific processing steps are as follows: (1) First, Approximate decomposition into ; in, The coefficient matrix (representing the weights of each class of base spectrum in each sample); H This is the fundamental spectrum matrix (each row corresponds to an absorption fundamental spectrum); It is based on the prior knowledge that radishes are mainly affected by three types of components: water, chlorophyll, and sugar.

[0056] The solution is obtained using a multiplication update rule, and the update formula is shown below: ; ; in, Let be the element in the k-th row and j-th column of matrix H; This represents the element in the i-th row and k-th column.

[0057] NMF successfully decomposed the spectrum into three fundamental spectra, and their main absorption regions and corresponding interpretations are shown in Table 3: Table 3. Data and interpretation of the main absorption regions of the fundamental spectrum (H) after decomposition.

[0058] The positions of these absorption peaks are highly consistent with the optical absorption peaks of radishes and root vegetables in published literature.

[0059] In addition, the coefficient matrix of NMF This reflects the relative abundance of the three physiological components in each spectrum. The average coefficients for different regions obtained by this invention are shown in Table 4. Table 4. Meaning and numerical values ​​of the coefficient matrix (W) for each region.

[0060] As can be seen from Table 4: (1) Fresh meat has the highest moisture content (up to 0.78) → indicating high moisture content; (2) The epidermal chlorophyll index is the highest (maximum is 0.42) → consistent with the plant structure; (3) As the storage time increases, the moisture index gradually decreases, such as only 0.52 in the aging area; (4) The sugar content coefficient is the highest among fresh meat (0.29), which is consistent with the characteristic that the sugar content of root vegetables accumulates from the epidermis to the interior and is relatively high during the fresh period.

[0061] By combining PCA, ICA and NMF, this invention successfully separated hyperspectral data into three physiological characteristic categories that are highly correlated with freshness—water factor, chlorophyll factor and sugar factor.

[0062] Each factor is represented in a quantifiable form through a mathematical decomposition algorithm, and has physical meaning (absorption peak position, coefficient value, and tissue structure change characteristics), thus providing reliable input parameters for the subsequent construction of a freshness scoring model.

[0063] Step 3: Based on the hyperspectral reflectance curve of each pixel, automatic identification and output of different tissue states of the radish, such as the skin, flesh, aging tissue, and drying areas, are achieved through spectral K-Means clustering and spectral domain similarity measurement. The specific steps are as follows: (I) First, for any pixel Constructing feature vectors: acquiring their wavelengths The reflectance at a given point forms the spectral vector: ;where R i ( ) represents the wavelength of the i-th pixel. The original reflectance value at n, where n = 1, 2, 3...n.

[0064] To reduce noise and highlight spectral shape features, the following operation is performed once for each curve: (1) SNV Normalization: A standard normal transformation is performed on each spectral curve to eliminate the multiplicative effects and additive baseline drift caused by surface scattering and optical path differences, while preserving the chemical absorption characteristics. The normalization formula is as follows: ; in, For the i-th spectral curve at wavelength The reflectance value after SNV normalization; For the i-th spectral curve in The original reflectance value at that location; and and are the mean and standard deviation of the reflectance of all points on the i-th spectral curve, respectively.

[0065] (2) First derivative enhanced absorption peak: The first derivative was calculated from the SNV-normalized spectral curve. This enhances the identification of absorption peak regions. The formula is shown below: .

[0066] (3) Standardize the spectral values and first derivative value The spectral feature vectors are concatenated to form a clustering function. : ; The feature dimension is approximately N = 2n ≈ 512.

[0067] (II) Subsequently, spectral angular distance (SAM) was used as the clustering distance to effectively eliminate the influence of light, enabling different tissue regions to be clustered based on the differences in their actual absorption peaks (such as the 680 nm chlorophyll absorption peak and the 970 nm water absorption peak), thereby obtaining two spectral feature vectors. and The spectral angular distance between them. The formula is as follows: ; in, and These represent two spectral vectors to be compared.

[0068] (III) Using the improved K-Means model, with the SAM calculated in step (II) as the distance metric and the number of clusters set, the adaptive region division of the radish tissue can be obtained. The specific steps are as follows: First, using the SAM calculated in step (II) as the distance metric, the resulting clustering objective function is to minimize the sum of squared spectral angular distances from all pixels to the cluster centers of their respective categories: ; Where M is the total number of pixels in the image; Let k be the set of pixels of class k. It is the spectral center (cluster center) of the kth class. This represents the total number of clusters.

[0069] The improved K-Means model was then used for iterative processing, as shown below: (1) Initialize K cluster centers; (2) Assign each pixel to the most similar category based on SAM distance: Based on the spectral angular distance, each pixel is classified into the cluster most similar to its spectral features, thus completing the initial pixel classification; (3) Update the cluster centers based on the spectra of all pixels in the classification to obtain: ; (4) Repeat steps (2) and (3) until the change in cluster centers is less than 10e. -6 At this point, the algorithm is considered to have converged, and the partitioning result is stable. The final partitioning result is shown below.

[0070] The area is divided into 6 categories, as shown below: Cluster 1: The spectral data of the epidermal region (dermis) is shown below: pixel percentage is 18.4%; the water peak depth at the cluster center (970 nm) is... The chlorophyll peak depth at the cluster center (680 nm) is The average moisture content is estimated at 61.2%; the average chlorophyll index is 0.32.

[0071] The spectrum in this region has a steep slope in the visible light region, shallow water absorption at 970 nm, and limited chlorophyll content; this is consistent with the typical characteristics of an epidermis with a cuticle and low water content.

[0072] Cluster 2: The spectral data of the fresh meat region (high water content region) is shown below: pixel percentage is 42.9%; the water peak depth at the cluster center (970 nm) is... The chlorophyll peak depth at the cluster center (680 nm) is The moisture content is 89.7%; the chlorophyll index is 0.48; and the sugar content is 4.2% (areas with higher freshness have higher soluble sugar content).

[0073] The fleshy cells in this area are plump, and the water absorption peak is significantly deepened, indicating that this area corresponds to the main tissue of a fresh radish.

[0074] Cluster 3: The spectral data of the slightly aged meat region is shown below: pixel percentage is 15.3%; 970 nm peak depth is... 680 nm peak shift Moisture content: 74.5%; Chlorophyll index: 0.41; Sugar content: 3.1%.

[0075] The chlorophyll peak in this region shows a slight shift (towards longer wavelengths), and the decrease in water content leads to a weakening of the absorption peak, which corresponds to the typical spectral characteristics of slight tissue aging.

[0076] Cluster 4: The spectral data of the severely aged region is shown below: pixel percentage is 10.2%; peak depth is 970 nm. 680 nm second-order differential peak The moisture content is 64.1%; the sugar content is 2.4%; and the spectrum shows an overall trend of flattening.

[0077] After the second derivative of this region is enhanced, the shape of the 680 nm absorption peak becomes sharp, indicating that the chlorophyll structure is damaged and the cell loses water severely, which is a typical decay region.

[0078] Cluster 5: The spectral data for the gradually drying region (region with rapid moisture loss) is shown below: pixel percentage is 9.0%; peak depth is 970 nm. The slope of the decrease in moisture index The moisture content is 58.5%.

[0079] The spectrum in this region decays rapidly in the near-infrared region (around 970 nm), directly reflecting the rapid loss of moisture. The negative slope further confirms that this region is in a period of rapid moisture loss.

[0080] Cluster 6: The spectral data of the lighting abnormal / high noise area is as follows: the pixel ratio is 4.2%; the spectral angle deviates from the overall center; this type will be marked as an unusable or area that needs to be removed.

[0081] (iv) For each cluster region obtained in step (iii), calculate and output a set of standardized quantitative indicators to systematically characterize the physiological characteristics of each type of region.

[0082] The calculation methods for these indicators are as follows: First, the area ratio of class A k : Used to reflect the spatial proportion of the k-th region in the entire image, the calculation formula is: ; in, This represents the area percentage of the k-th class. represents the number of pixels in the k-th class; M represents the total number of pixels in the image.

[0083] Secondly, the average reflectance curve It describes the k-th class region at any wavelength. The average spectral response characteristics at that location are calculated using the following formula: ; in, Indicates the k-th type region at wavelength Average reflectance at; The number of pixels in the k-th class; This represents the reflectance of the i-th pixel in the set at wavelength λ.

[0084] Third is average moisture. (Estimated based on water absorption characteristics at 970 nm), the calculation formula is as follows: ; in, Let be the average reflectance of the k-th region near 970 nm.

[0085] Fourth is the average chlorophyll index. (Constructed based on chlorophyll absorption characteristics at 680 nm), the calculation formula is: ; in, Let be the average reflectance of the k-th region near 680 nm.

[0086] 5. Average sugar content (Estimated using the reflectance slope in the 550–600 nm wavelength range), the calculation formula is: ; in, This represents the reflectance slope of the k-th region in the wavelength range of 550–600 nm; and These are all empirical coefficients, and the values ​​were selected after optimization. =2.18, =0.87.

[0087] The above results are all derived from actual spectral calculations, are traceable and reproducible, and are in strict agreement with the physiological characteristics of radishes.

[0088] Step 4: Building the Model After establishing the decay model based on step three, a freshness-related mathematical model is constructed, and the specific steps are as follows.

[0089] (a) Constructing a moisture decay model The moisture decay index is defined as: ; in, This indicates the peak depth at 970 nm in the current spectrum; This represents the reference peak depth for fresh radishes. A semi-parametric model for moisture decay is established based on this index, as shown in the following formula: ; The experimental fitting yielded parameters a=85, b=5, and k1=4.2; these were used to quantify the impact of moisture loss on freshness.

[0090] (II) Constructing a linear decay model for chlorophyll decay The change in chlorophyll a content is represented by the absorption peak at 680 nm in the visible light region. First, the first derivative or linear fitting curve is obtained by characterizing the absorption peak at 680 nm to obtain the decay rate of chlorophyll a, and then a linear decay formula of chlorophyll is constructed.

[0091] The decay rate formula is: ; in, This represents the change in the depth of the absorption peak at 680° in the current spectrum. It is a relative time unit (a sequence number can be used instead of the actual post-collection time).

[0092] The linear decay formula is: ; The parameters can be obtained from experimental fitting: c=92; d=220, reflecting the linear effect of chlorophyll degradation on freshness.

[0093] (III) Exponential decay model based on sugar content Soluble sugar content is related to radish sweetness and cell integrity, and is an auxiliary indicator of freshness. Sugar decay can be approximately characterized by the reflectance slope (Slope_sugar) in the 550–600 nm region of the spectrum.

[0094] The formula for the exponential decay of sugar content is: ; Among them, the sugar loss index ; This indicates the peak depth of the current spectrum in the 550-600 nm range; The reference peak depth indicates the fresh radish. =15, =6 (the parameters can be obtained by experimental fitting).

[0095] (iv) Establishing a mathematical model for regional zoning stability SpectralClusteringStability is used to measure whether the spectra of pixels within the same tissue region are still clustered into the same type of spectral cluster at different times (or adjacent time series). The modeling process is shown below.

[0096] (1) Define pixel clustering labels: For the spectral clustering results of the t-th time series, define a set of pixel labels. for: ; in, It is the cluster label of the i-th pixel (or region of interest ROI).

[0097] (2) Define the consistency of adjacent time series: Calculate the consistency of pixels between two adjacent time steps (t and t-1): ; in, It is an indicator function; it indicates whether "the same pixel still belongs to the same spectral class in two consecutive time sequences".

[0098] (3) Overall regional zoning stability: The overall regional partitioning stability is obtained by averaging the consistency results calculated for all time series (T time series). : ; in, The value range is naturally between [0, 1].

[0099] (V) Mathematical Model for the Stability of Spectral Shape Parameters ShapeParamStability measures whether the spectral "shape characteristics" remain smooth and continuous over time, rather than fluctuating drastically; the modeling process is shown below: (1) Define the shape parameter vector: Suppose that in a certain region (or cluster), the extracted shape parameter vector for: ; in, This indicates the depth of the absorption peak at a wavelength of 680 nm; This indicates the depth of the absorption peak at a wavelength of 970 nm; This indicates the shift of the absorption peak at 680 nm; It represents the reflection slope within a specific spectral range.

[0100] (2) Define the shape change amplitude of adjacent time series: Calculate the Euclidean distance between the shape parameter vectors of two adjacent time series (t and t-1) as the magnitude of change. Measurement: ; in, and Let represent the spectral shape parameter vectors for time series t and t-1, respectively.

[0101] (3) Normalize and define stability : ; in, Indicates the empirical scale parameter (obtained from sample statistics); magnitude of change. The smaller the value, the greater the stability. The closer it is to 1.

[0102] (4) Overall shape stability: The overall spectral shape parameter stability is obtained by averaging the stability results calculated for all time series (T time series). : ; Where T represents the total number of time series, t=0,1,2,……,T-1.

[0103] Summary: Regional zoning stability ( The K-Means clustering method is used to measure the consistency of spectral clustering results of the same tissue region at different time series. Its calculation is based on the temporal consistency of pixel labels in the aforementioned spectral K-Means clustering results. The stability of spectral shape parameters is used to characterize the smoothness of the changes in shape parameters such as absorption peak depth, peak position and spectral slope over time. Its calculation is based on the change amplitude of spectral shape parameter vectors between adjacent time series.

[0104] (vi) Multi-index fusion model Taking into account the three core indicators of moisture, chlorophyll, and sugar content, and incorporating both regional clustering stability and spectral shape parameter stability, a multi-index fusion model is obtained through weighted fusion: ; The weighting coefficients are set as follows: α=0.45; β=0.30; γ=0.05; δ=0.05; ε=0.15. (The sum of α, β, γ, δ, and ε is 1, ensuring that the Freshness_Index is within the range of 0-100.) The higher the index value, the higher the freshness of the radish, thus achieving a comprehensive quantitative assessment of multi-dimensional physiological characteristics.

[0105] Example 2: In this embodiment, the radish sample to be tested is calculated using the method described in Example 1 to calculate its comprehensive freshness index, Freshness_Index. The index ranges from 0 to 100, and the larger the value, the higher the freshness of the sample.

[0106] Considering the actual needs of the consumer market and warehouse management for freshness grades, this embodiment uses a threshold segmentation method to classify the comprehensive freshness index. By setting two thresholds T1 and T2, the radish samples are divided into three freshness grades: Grade 1 (fresh), Grade 2 (medium fresh), and Grade 3 (not fresh). Table 5. Grading Standards for Freshness of Radish Samples

[0107] Where T1=70, T2=40.

[0108] Example 3: Based on Example 1, a radish stored for 15 days was tested, and the test results are shown in Table 5.

[0109] Table 5. Pixel area metrics of the radish after 15 storage cycles

[0110] Substitute the above indicators into the multi-index fusion model to calculate the comprehensive freshness index: ; Calculate by substituting the data .

[0111] Simultaneously, the radish was tested using a traditional method, and the traditional freshness value was measured to be 50.3, with a calculated relative error of 1.19%. The results show that there is no difference in the experimental data obtained by the two methods.

Claims

1. A method for detecting the freshness of radishes based on hyperspectral imaging, characterized in that: Includes the following steps: S1: Obtain the hyperspectral data of a currently detected radish and several comparison radishes to form a hyperspectral image of the currently detected radish; And obtain the hyperspectral data of radishes from several testing standards in the database; S2: Perform normal variable transformation correction and weighted Savitzky-Golay filtering preprocessing on the hyperspectral image of the radish obtained in step S1 to obtain the changes in hyperspectral peak depth, absorption peak shift and spectral slope. S3: Principal component analysis, independent component analysis and non-negative matrix decomposition were used to perform spectral decomposition on the hyperspectral features after the processing in step S2, and physiological component factors reflecting the physiological state of radish samples were extracted. S4: Identify and output the tissue state of radish samples through spectral K-Means clustering and spectral domain similarity measurement; S5: Based on the data obtained from steps S2 and S4, construct the water decay model, the linear decay model of chlorophyll decay, the exponential decay model of sugar content, the regional partitioning stability model, and the spectral shape parameter stability model, respectively, and then obtain the mathematical model of radish sample freshness through weighted fusion. S6: Use the mathematical model obtained in step S5 to predict the freshness of the radish to be tested.

2. The method for detecting radish freshness based on hyperspectral imaging according to claim 1, characterized in that: In S3, the physiological component factors are independent water factor, independent chlorophyll factor, and independent sugar factor.

3. The method for detecting radish freshness based on hyperspectral imaging according to claim 1, characterized in that: In step S4, the spectral K-Means clustering process is as follows: A1: For any pixel in the spectral curve Constructing spectral feature vectors And based on this feature vector, clustering is performed using spectral angular distance as the clustering distance; A2: Using spectral angular distance as the distance metric, the clustering objective function is obtained. M is the total number of pixels in the image; Let k be the set of pixels of class k. For the spectral center of class k, This represents the total number of clusters. A3: Iterate the clustering objective function obtained in step A2 using the K-Means model until the change in cluster centers is less than 10e. -6 This allows for the partitioning of radish samples.

4. The method for detecting radish freshness based on hyperspectral imaging according to claim 3, characterized in that: The iterative process of step A3 is as follows: (1) Initialize K cluster centers; (2) Assign each pixel to the most similar category based on SAM distance: Based on the spectral angular distance, each pixel is classified into the cluster most similar to its spectral features, thus completing the initial pixel classification; (3) Update the cluster centers based on the spectra of all pixels in the classification to obtain: ; (4) Repeat steps (2) and (3) until the change in cluster centers is less than 10e. -6 At this point, the algorithm is considered to have converged and the partitioning results are considered stable.

5. The method for detecting radish freshness based on hyperspectral imaging according to claim 1, characterized in that: In step S5, the mathematical model for the freshness of the radish samples obtained by weighted fusion is: , in, For moisture decay model; This is a linear decay model for chlorophyll decline; For regional partitioning stability models; For the stability model of spectral shape parameters; This is an exponential decay model for sugar content.

6. The method for detecting radish freshness based on hyperspectral imaging according to claim 5, characterized in that: The moisture decay model is as follows: ,in ; This indicates the peak depth at 970 nm in the current spectrum; The reference peak depths for fresh radishes are: a=85, b=5, and k1=4.

2. The linear decay model of chlorophyll decay is as follows ;in, ; This represents the change in the depth of the absorption peak at 680° in the current spectrum. These are relative time units; c=92; d=220; The exponential decay model of sugar content is as follows: ;in Sugar loss index ; This indicates the peak depth of the current spectrum in the 550-600 nm range; The reference peak depth indicates the fresh radish. =15, =6.

7. The method for detecting radish freshness based on hyperspectral imaging according to claim 5, characterized in that: In the mathematical model for the freshness of radish samples obtained by weighted fusion, α is 0.45, β is 0.30, γ is 0.05, δ is 0.05, and ε is 0.

15.

8. The method for detecting radish freshness based on hyperspectral imaging according to claim 5, characterized in that: The regional partitioning stability model is as follows: ;in, , Let be the set of spectral clustering results for the t-th time series; Let T be the set of spectral clustering results for the (t-1)th time series, where T is the total number of time series and N is the total number of pixels. The mathematical model for the stability of the spectral shape parameter is as follows: ;in, ;in, Represents the empirical scale parameter; The Euclidean distance between two adjacent time steps is the shape parameter, and T is the total number of pixels.

9. The method for detecting radish freshness based on hyperspectral imaging according to claim 1, characterized in that: The S6 step also includes: after predicting the freshness of the radish to be tested, evaluating it according to the freshness grade of the radish sample.

10. The method for detecting radish freshness based on hyperspectral imaging according to claim 9, characterized in that: The rating method for the freshness level of radish samples is as follows: a threshold segmentation method is adopted, by setting a first threshold T1 and a second threshold T2, and judging according to the value range of the comprehensive index F: when F is greater than or equal to T1, the radish sample is rated as fresh; when F is less than T1 but greater than or equal to T2, the radish sample is rated as slightly fresh; when F is less than T2, the radish sample is rated as not fresh.

Citation Information

Cited By

  • A method and system for constructing a leafy vegetable freshness detection model

    CN122174185A