A hyperspectral non-destructive detection and grading method for internal and external browning of fruits
By integrating spectral and image information from hyperspectral imaging technology and selecting characteristic wavelengths, a non-destructive detection model for browning of the outer peel and inner flesh of fruit was constructed. This method overcomes the shortcomings of traditional detection methods, enables rapid and accurate fruit quality grading, and improves the stability and generalization ability of the model.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HEBEI ACADEMY OF AGRI & FORESTRY SCI INST OF GENETICS & PHYSIOLOGY
- Filing Date
- 2026-03-11
- Publication Date
- 2026-06-12
AI Technical Summary
Traditional methods are difficult to achieve non-destructive, rapid, and accurate detection of browning of the outer peel and inner flesh of fruits. Furthermore, hyperspectral data is easily affected by noise, resulting in poor model stability and insufficient generalization ability.
By integrating spectral and image multidimensional information from hyperspectral imaging technology, characteristic wavelengths were selected to construct a browning grading model for the outer peel of the fruit and a browning discrimination model for the inner flesh. BP neural network, support vector machine, and random forest algorithms were used for modeling, and principal component analysis and characteristic wavelength selection were combined for optimization.
It enables non-destructive detection of browning grades on the outer peel of fruits and accurate identification of browning in the inner flesh, improving the accuracy and robustness of the model. It is suitable for quality sorting of fruits prone to browning, reducing post-harvest losses and increasing product added value.
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_3
Abstract
Description
Technical Field
[0001] This invention belongs to the field of non-destructive testing and intelligent grading technology for fruit quality. Specifically, it relates to a hyperspectral non-destructive testing and grading method for internal and external browning of fruits. Background Technology
[0002] Browning of both the outer peel and the inner flesh of fruit is common during post-harvest storage. In the early stages of peel browning, irregular brown patches appear on the fruit surface, gradually expanding and darkening with prolonged storage. This phenomenon is often associated with chilling injury and is frequently exacerbated when fruit is transferred from a low-temperature environment to a shelf environment. Pulp browning is a storage-related physiological disorder, primarily induced by chilling injury and gas damage, severely damaging the fruit's nutrition and flavor. Browning significantly reduces the commercial value of fruit and has become a core bottleneck restricting the sustainable development of the fruit industry and off-season sales. Therefore, rapid, non-destructive monitoring and accurate grading of fruit browning during storage, logistics, and sales are crucial for reducing post-harvest losses and increasing product added value.
[0003] Traditional fruit peel browning grading relies primarily on manual visual inspection, a method that is highly subjective, lacks consistent standards, and is deficient in early identification capabilities. Internal flesh browning is typically assessed through dissection or sampling, but these methods are time-consuming, labor-intensive, and destructive, making it impossible to screen all fruits. Therefore, traditional methods fail to meet the demands of modern fruit and vegetable sorting for efficient, accurate, and non-destructive testing.
[0004] Hyperspectral imaging technology boasts the advantage of "image and spectrum integration," simultaneously acquiring spatial image information and continuous spectral information of the object under test. It has been widely applied to the non-destructive testing of internal quality (such as sugar content, acidity, and moisture) and external defects (such as diseases and damage) in fruits and vegetables, providing a strong technical foundation for fruit quality assessment. However, hyperspectral data typically features a large number of bands, high dimensionality, and strong correlations between variables. Directly modeling based on raw hyperspectral data is susceptible to interference from noise, scattering differences, and baseline drift, resulting in poor model stability, insufficient generalization ability, and high computational complexity, making online deployment difficult. Furthermore, in addition to changes in spectral response, browning of the fruit peel is often accompanied by changes in surface color, texture, and other image features. Relying solely on spectral information is insufficient to fully characterize the subtle differences between different browning grades, leading to inadequate grading accuracy. Introducing image features without constraints may cause feature redundancy and overfitting risks, reducing model robustness. For internal fruit pulp browning, effectively screening characteristic wavelengths related to browning from high-dimensional spectral data and eliminating redundant information is crucial for improving the accuracy and computational efficiency of the detection model.
[0005] To address the aforementioned problems, this invention provides a hyperspectral non-destructive detection and grading method for internal and external browning of fruits. By fusing multidimensional information from spectra and images and effectively filtering characteristic wavelengths, it can simultaneously achieve non-destructive detection of browning in both the outer peel and the inner flesh of the fruit, and then perform discrimination and grading. Summary of the Invention
[0006] The purpose of this invention is to provide a hyperspectral non-destructive detection and grading method for internal and external browning of fruits. This method can be used for non-destructive detection of any fruit prone to browning, such as pears and apples.
[0007] To achieve the aforementioned objective, the present invention employs the following technical solution: A hyperspectral nondestructive detection and grading method for internal and external browning of fruits, comprising the following steps: S1: Sample preparation and storage: Fruits with uniform appearance, free from pests and diseases, and without external defects were selected and placed in a 0℃ cold storage for 180 days to obtain fruit samples with different degrees of browning of peel and pulp; the storage temperature of the obtained samples was controlled at 0±1℃.
[0008] To ensure a sufficient number of browning samples for subsequent experiments, the storage quantity should be appropriately increased during selection; among them, no fewer than 750 fruit samples should be used for peel browning analysis, and no fewer than 400 fruit samples should be used for pulp browning analysis.
[0009] S2: Data Acquisition and Browning Grade Calibration: A hyperspectral imaging system was used to collect data on fruit samples with different degrees of browning of the peel and pulp, resulting in hyperspectral images of the fruits with different degrees of browning of the peel and pulp.
[0010] During data acquisition, the hyperspectral imaging system was set to operate in the 400-1000 nm band, the distance between the fruit surface and the camera lens was 200 mm, the translation stage moving speed was 7.35 mm / s, the camera exposure time was 8.50 ms, and the imaging spectrometer had a spectral resolution of 5.5 nm.
[0011] After data collection, the browning level of the fruit samples was determined: For the peel, the percentage of browning area was calculated using image processing software (ImageJ). Based on the percentage, fruit samples with different degrees of browning were classified into grades 0, 1, and 2. Grade 0 had a browning area percentage of 0%, grade 1 had a browning area percentage of <25%, and grade 2 had a browning area percentage of ≥25%. For the pulp, the browning was observed by cutting. Samples without browning were classified as grade 0, and samples with browning were classified as grade 1.
[0012] S3: Data Preprocessing and Preliminary Modeling The original hyperspectral data was corrected for black and white according to the correction formula (1) to eliminate the effects of uneven illumination and dark current noise. (1) in, Represents the original average spectral reflectance. Represents the dark reference image. Indicates a white reference image, This indicates the corrected reflectance; In the corrected hyperspectral image, the entire fruit area is selected as the region of interest (ROI), and the average reflectance of all pixels in the region at each band is calculated as the average reflectance spectrum of the sample. The average reflectance spectrum of the ROI is preprocessed to eliminate the effects of scattering differences, baseline drift, and noise interference. The data preprocessing methods include one or more combinations of Standard Normal Variable Transform (SNV), First Derivative (FD), and Second Derivative (SD). Then, based on the preprocessed spectral data, the samples were divided into training and prediction sets in a 3:1 ratio. Backpropagation neural network (BPNN), support vector machine (SVM), and random forest (RF) algorithms were used to construct a grading model for the degree of browning of the outer peel and a discrimination model for whether the inner pulp is brown. The accuracy of the models was evaluated by confusion matrix and accuracy, and the optimal algorithm model for different detection tasks was selected.
[0013] S4: Based on the aforementioned optimal algorithm model, further feature optimization and fusion modeling are performed: Specifically, for the grading of different browning degrees of the fruit's outer peel, the preprocessed spectral data is dimensionality-reduced using principal component analysis (PCA) to extract principal component scores as features; simultaneously, image features are extracted from the ROI regions of fruits with different browning degrees; the dimensionality-reduced spectral data and the extracted image features are fused to form a fused feature vector, and a grading model for the browning degree of the outer peel is further constructed based on the fused feature vector.
[0014] To identify browning of the fruit pulp inside, based on the preprocessed spectral data, key variables are extracted by screening for characteristic wavelengths to obtain the characteristic wavelengths of the spectrum. The obtained characteristic wavelength data of the spectrum is then used to further construct a model for identifying browning inside the fruit.
[0015] The methods for feature wavelength selection include the Competitive Adaptive Weighted Algorithm (CARS) and the Continuous Projection Algorithm (SPA).
[0016] The image features include texture features and color features based on the gray-level co-occurrence matrix (GLCM).
[0017] When extracting texture features based on GLCM, a step size of d=1 is preset, and GLCM is constructed along four directions: 0°, 45°, 90° and 135°. Based on the matrix constructed in each direction, the corresponding texture feature parameters are calculated. Then, the mean of each texture feature parameter obtained in the four directions is calculated to obtain the final texture feature vector.
[0018] The texture feature parameters include mean, standard deviation, contrast, dissimilarity, homogeneity, second moment of angle, energy, maximum probability, and entropy.
[0019] The color features are 9-dimensional statistical features based on the fusion of multiple color spaces, and consist of the following components: R channel features, G channel features, B channel features, HSV space hue features (HSV-H), HSV space saturation features (HSV-S), HSV space brightness features (HSV-V), HSI space hue features (HSI-H), HSI space saturation features (HSI-S), and HSI space intensity features (HSI-I).
[0020] The 9-dimensional statistical feature construction method is as follows: the original ROI image is transformed from the RGB color space to the HSV color space and the HSI color space respectively, and the average value of the pixel component of each channel in the RGB, HSV and HSI color spaces is calculated respectively.
[0021] In the method of this invention, by fusing the spectral and image dimensional information of hyperspectral images and combining feature selection and dimensionality reduction techniques, a non-destructive detection method is constructed that can simultaneously classify the browning level of the fruit's outer peel and determine whether the internal flesh has browning. The fusion of spectral data and image features improves the accuracy of the outer peel browning degree grading model; feature wavelength selection improves the computational efficiency of the internal flesh browning discrimination model.
[0022] Beneficial effects This invention provides a rapid, accurate, stable, and non-destructive method for detecting internal and external browning of fruits. It constructs a high-precision grading model for the degree of browning of the external peel and a discrimination model for browning of the internal pulp, which has good stability and generalization ability. It can be widely applied to the quality sorting of fruits that are prone to browning, and has important practical significance for reducing post-harvest losses, increasing product added value, and promoting the intelligent upgrading of fruit sorting equipment.
[0023] Compared with the prior art, the method of the present invention has the following beneficial effects: 1. Achieves non-destructive testing and precise grading: This invention overcomes the shortcomings of traditional manual visual inspection, such as strong subjectivity, inconsistent standards, and destructive cutting inspection. By using hyperspectral imaging technology, it can simultaneously obtain information on the grade of browning of the outer peel and the discrimination information of browning of the inner pulp without damaging the fruit, providing a reliable technical means for the automated sorting of fruit quality.
[0024] 2. Significantly improved model accuracy and robustness: For peel browning, the model integrates spectral information with image features such as color and texture, solving the problem that single spectral data is difficult to distinguish subtle browning differences; for flesh browning, the model uses CARS and SPA algorithms to filter feature wavelengths, eliminating redundant information and noise, reducing model complexity, and improving the model's prediction accuracy and generalization ability.
[0025] 3. Strong applicability to data processing: Two different optimization strategies—feature fusion and feature wavelength selection—are employed to address the distinct characteristics of external and internal browning, achieving precise modeling that differentiates between internal and external browning. This method can be used for quality detection and intelligent grading of fruits prone to browning, showing broad application prospects. Attached Figure Description
[0026] Figure 1 The images used in the examples show Huangguan pears with different grades of peel browning. The grades of peel browning are from left to right: no browning, slight browning, and severe browning.
[0027] Figure 2 The images used in the examples show pears with normal peel, pears with browned flesh after cutting, and pears with no browned flesh, from left to right: normal peel, no browned flesh, and browned flesh.
[0028] Figure 3 a is the average spectral reflectance curve of Huangguan pears with different peel browning grades used in the example.
[0029] Figure 3 b is a graph showing the average spectral reflectance of pears with browned and non-browned flesh used in the example.
[0030] Figure 4 The images shown are grayscale images and GLCM texture feature visualization results of Huangguan pears with different browning levels of peel used in the example. The images, from top to bottom, are: no browning, slight browning, and severe browning.
[0031] Figure 5 The images used in this example are visualization results of the Huangguan pears with different degrees of peel browning in each channel component in RGB, HSV and HSI space. From top to bottom, the images show: no browning, slight browning, and severe browning.
[0032] Figure 6 This is a schematic diagram of the principal component interpretation variance distribution of the original spectra of Huangguan pears with different peel browning grades used in the examples, after PCA analysis.
[0033] Figure 7 The image shows the confusion matrix for classifying the browning grade of Huangguan pear peel based on the BPNN algorithm, which integrates PCA dimensionality reduction features and GLCM texture features. The left image is the confusion matrix for the training set, and the right image is the confusion matrix for the test set.
[0034] Figure 8 The image shows the confusion matrix for browning discrimination of pear flesh based on the BPNN algorithm combined with SPA feature wavelength screening. The left image is the confusion matrix for the training set, and the right image is the confusion matrix for the test set. Detailed Implementation
[0035] The present invention will be further described in detail below with reference to embodiments, so as to more clearly illustrate the purpose, technical solution and advantages of the present invention. The embodiments described are merely preferred illustrative examples and do not constitute any limitation on the present invention. Various modifications and variations can be made by those skilled in the art. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention fall within the protection scope of the present invention.
[0036] The fruit samples used in the examples were Ya pear and Huangguan pear; the Ya pear sample was collected on August 26, 2024, from a commercial orchard in Xinji City, Hebei Province (37.94°N, 115.22°E) for internal flesh browning detection; the Huangguan pear sample was collected on August 10, 2024, from an orchard in Zhao County, Hebei Province (37.77°N, 114.96°E) for external peel browning detection.
[0037] Example 1. Sample Preparation After collection, samples of Ya pears and Huangguan pears were immediately transported back to the laboratory. Mechanically damaged and diseased fruits were removed, and only fruits with uniform appearance, clean surfaces, and consistent size were selected. 400 Ya pears selected for flesh browning analysis and 750 Huangguan pears selected for peel browning analysis were stored in a cold storage at (0±1)℃ for 180 days to induce different degrees of browning. After storage, the samples were removed and equilibrated at room temperature for 2 hours before subsequent experiments. Unqualified samples were discarded, resulting in 645 qualified Huangguan pears for the peel browning grading model and 360 qualified Ya pear samples for the flesh browning grading model.
[0038] 2. Hyperspectral Imaging System A pushbroom hyperspectral imaging system (HSI) was employed, which mainly consisted of the following components: a spectral imaging unit (containing a hyperspectral camera and a CMOS detector, with a spatial resolution of 1024 pixels, a pixel size of 8 μm × 8 μm, 448 spectral channels, a spectral range of 400-1000 nm, and a spectral resolution of 5.5 nm), a hyperspectral imaging workstation (Labscanner 40×20), an illumination system (six 170 W halogen lamps on both sides), and a computer equipped with control software. The system's imaging speed was 330 fps.
[0039] 3. Image acquisition and correction Before image acquisition, the light source was turned on and preheated for 30 minutes to allow the system to reach a stable state. The acquisition parameters were set as follows: stage movement speed 7.35 mm / s, camera exposure time 8.50 ms, and object distance (distance between the pear fruit surface and the lens) 200 mm. Hyperspectral images of the pear fruit were acquired using a line scan method.
[0040] Due to factors such as dark current and uneven illumination, according to the correction formula The original image is then corrected for black and white color. The corrected hyperspectral image is used for subsequent image analysis and spectral extraction.
[0041] in, This represents the corrected reflectance. Represents the original average spectral reflectance. Represents the dark reference image. The reference image is shown.
[0042] 4. Browning degree calibration 4.1 Grading of browning of the outer pericarp of Huangguan pear ImageJ software was used to calculate the percentage of browned area on the peel surface of each Huangguan pear sample. Based on the percentage of browned area, the samples were divided into three grades (…). Figure 1 Grade 0: No browning of the peel (browning area percentage = 0); Grade 1: Slight browning (browning area percentage < 25%); Grade 2: Severe browning (browning area percentage ≥ 25%).
[0043] 4.2 Identification of browning in the internal flesh of pears The pear samples were cut open along the equator, and the flesh was visually inspected for browning areas. Based on the observation results, they were divided into two categories ( Figure 2 Grade 0: The flesh is not brown; Grade 1: The flesh is brown.
[0044] 5. Data Analysis 5.1 Selection of Region of Interest (ROI) and Spectral Extraction Using ENVI 5.0 software, a whole region of the sample was manually selected as the Region of Interest (ROI) in each corrected hyperspectral image. The average reflectance of all pixels within the ROI in each band was calculated to obtain the average reflectance spectrum of the sample, which served as the basis for subsequent spectral data.
[0045] Figure 3 a shows the average spectral reflectance of Huangguan pear samples with different grades of peel browning. Figure 3 b shows the average spectral reflectance of pear samples with browned and unbrowned flesh. It can be seen that the average spectral reflectance of Huangguan pear samples with different grades of peel browning differs, and the average spectral reflectance of pear samples with browned and unbrowned flesh also differs. Further analysis can be conducted based on the average spectral reflectance of the samples.
[0046] 5.2 Spectral Preprocessing To eliminate scattering effects, baseline drift, and noise interference, one or more combined preprocessing methods, such as Standard Normal Variable Transform (SNV), First Derivative (FD), and Second Derivative (SD), are used to preprocess the average reflectance spectrum of the samples in order to screen out the optimal preprocessing method and improve model performance.
[0047] 5.3 Extraction of image features of browning on the outer pericarp of Huangguan pear For the Huangguan pear sample, two types of image features were extracted based on the ROI image: (1) Texture features: First, convert the ROI image to a grayscale image; preset step size Gray-level co-occurrence matrices (GLCMs) are constructed along four directions: 0°, 45°, 90°, and 135°. Based on the matrices constructed in each direction, corresponding texture feature parameters are calculated. These texture feature parameters include mean, standard deviation, contrast, dissimilarity, homogeneity, second moment of angle, energy, maximum probability, and entropy. Then, the mean of each texture feature parameter obtained in the four directions is calculated to obtain the final texture feature vector, as shown in Table 1. Figure 4 As shown.
[0048] (2) Color Features: The ROI image is converted from RGB color space to HSV color space and HSI color space respectively; based on the converted color space, statistics of hue, saturation, brightness and intensity are extracted respectively; wherein, the statistics include the mean and its standard deviation; according to the preset feature dimensions, the feature components of RGB space and the converted space are fused to obtain 9-dimensional color feature parameters, specifically: R component, G component, B component in RGB space, H component, S component, V component in HSV space, and H component, S component, I component in HSI space, as shown in Table 2 and Figure 5 As shown.
[0049] The specific values of the extracted texture and color features are shown in Tables 1 and 2. It can be seen that the samples with different browning grades show certain differences in each feature.
[0050] Table 1. Mean values of GLCM texture characteristics of Huangguan pear with different grades of peel browning. Table 2. Mean values of color characteristics of Huangguan pears with different grades of peel browning. 5.4 Screening of characteristic wavelengths for detecting browning in the flesh of pears For identifying browning of the flesh inside pears, spectral information is mainly relied upon, without the need for image features. To reduce data dimensionality and computational complexity, a competitive adaptive weighted algorithm (CARS) and a continuous projection algorithm (SPA) are used to screen feature wavelengths across the entire spectrum. This significantly simplifies the model while maintaining accuracy. The feature wavelengths screened by different feature wavelength screening algorithms are shown in Table 3.
[0051] Table 3 Feature wavelengths selected using different feature wavelength selection algorithms 6. Model Building and Optimization All samples were randomly divided into training and prediction sets in a 3:1 ratio. Backpropagation neural network (BPNN), vector machine (SVM), and random forest (RF) were used as classification models. The model performance was evaluated by the accuracy of the training and prediction sets, and the model with the highest accuracy was selected.
[0052] 6.1 Preliminary Modeling and Algorithm Selection Based on the raw spectral data before preprocessing, BPNN, SVM, and RF were used to construct a browning grading model for Huangguan pear peel and a browning discrimination model for Ya pear flesh, respectively. The results are shown in Tables 4 and 5. Table 4 shows that BPNN achieved an accuracy of 71.9% on the test set when identifying peel browning grading, which is better than the 55.6% of the SVM model and the 61.8% of the RF model. Table 5 shows that BPNN achieved an accuracy of 85.6% on the test set when judging whether the flesh is brown, which is better than the 63.3% of the SVM model and the 68.0% of the RF model. It can be seen that the BPNN algorithm performs best in both grading models compared to the SVM and RF models; therefore, subsequent model optimization will be based on BPNN.
[0053] Table 4. Grading models of browning of Huangguan pear peel based on different classification algorithms. Accuracy on training and test sets Table 5. Discrimination models for browning of pear flesh constructed based on different classification algorithms. Accuracy on training and test sets 6.2 Spectral preprocessing results The original spectra were preprocessed using FD, SD, SNV, and combinations thereof. Using the preprocessed data, a BPNN algorithm was applied to construct a browning grading model for Huangguan pear peel and a browning discrimination model for Ya pear flesh. The results are shown in Tables 6 and 7. The accuracy of the preprocessed model test set shows that the SD-SNV preprocessing method improved the accuracy of peel browning grading from 71.9% to 80.6%, and significantly improved the accuracy of flesh browning from 85.6% to 100%. Therefore, SD-SNV is the preferred preprocessing method for subsequent model optimization.
[0054] Table 6. Grading model of Huangguan pear peel browning based on BPNN algorithm and different preprocessing methods. Accuracy on training and test sets Table 7. A browning discrimination model for pear flesh constructed based on BPNN algorithm and different preprocessing methods. Accuracy on training and test sets 6.3 Feature Optimization and Fusion Modeling 6.3.1 Grading of browning in Huangguan pear peel: Characteristic fusion Principal component analysis (PCA) was performed on the spectral data preprocessed by SD-SNV, and the top 9 principal components with a cumulative variance contribution rate of 99.37% were retained. Figure 6 The spectral dimensionality reduction features were obtained. These spectral dimensionality reduction features were then fused with the previously extracted image features in different combinations and input into the BPNN model. The accuracy results of the models constructed using different fused feature combinations on the test and training sets are shown in Table 8. As can be seen from Table 8, the test set accuracy of the Huangguan pear peel browning grading model constructed using different fused feature combinations based on the BPNN algorithm is superior to that of the model constructed using SD-SNV preprocessed data. Among them, the highest test set accuracy (89.1%) was achieved when fusing PCA dimensionality reduction spectral and GLCM texture features; its confusion matrix is shown in [Table 8]. Figure 7 Furthermore, the number of variables in this fusion feature is 18, which significantly reduces the computational complexity compared to the 448 variables in the original data. Therefore, the feature vector fused with PCA dimensionality reduction features and GLCM texture features is preferred as the final input feature of the Huangguan pear peel browning grading model.
[0055] Table 8. Grading model of Huangguan pear peel browning based on BPNN algorithm and different fusion features. Accuracy on training and test sets 6.3.2 Identification of browning in pear flesh: Screening based on characteristic wavelengths Based on the spectral data preprocessed by SD-SNV, CARS and SPA feature wavelength screening algorithms were used respectively. The screened spectral data were then input into a BPNN to construct a model for judging browning of pear flesh. The results are shown in Table 9. Table 9 shows that the accuracy of the test set of the models constructed based on the spectral data screened by different feature wavelength screening algorithms can all reach 100%. Among them, the SPA-screened model has the fewest feature wavelength data, with only 7 variables, yet it achieves the same 100% test set accuracy as the original 448 variables (confusion matrix is shown in Table 9). Figure 8 Using this feature vector as the final feature vector can significantly reduce the computational complexity of the model. Therefore, the data after SD-SNV preprocessing combined with SPA feature wavelength screening is preferred as the final scheme for judging browning of the internal flesh of pears.
[0056] Table 9. BPNN Algorithm and Different Feature Wavelength Filtering Methods Accuracy of constructing a model for determining whether pear fruit has browned on the training and test sets. Therefore, the preferred implementation procedure for the hyperspectral non-destructive testing method for internal and external browning of pear fruit is as follows: (1) For browning of the outer peel of pear fruit (taking Huangguan pear as an example): acquire hyperspectral image → black and white correction → select whole fruit ROI → extract average reflectance spectrum → SD-SNV preprocessing → PCA dimensionality reduction of preprocessed spectrum → extract GLCM texture features of ROI → fuse PCA dimensionality reduction spectrum and GLCM texture features → input BP neural network model and output browning level (0 / 1 / 2 level). (2) For browning of internal pulp (taking pear as an example): acquire hyperspectral image → black and white correction → select whole fruit ROI → extract average reflectance spectrum → SD-SNV preprocessing → use SPA algorithm to screen feature wavelengths → input the screened feature wavelength data into BP neural network model and output whether browning occurs (0 / 1 level).
Claims
1. A hyperspectral non-destructive detection and grading method for internal and external browning of fruits, comprising the following steps: S1: Select fruits with uniform appearance, free from pests and diseases, and free from external defects, and store them in a 0℃ cold storage for 180 days to obtain fruit samples with different degrees of browning of peel and pulp; the storage temperature of the fruit samples is controlled at 0±1℃. S2: A hyperspectral imaging system is used to collect data on fruit samples with different degrees of browning of peel and pulp to obtain their hyperspectral images; after the data collection is completed, the browning level of the fruit samples is calibrated. S3: Perform black-and-white correction on the acquired raw hyperspectral data according to the correction formula (1): (1) in, Represents the original average spectral reflectance. Represents the dark reference image. Indicates a white reference image, This indicates the corrected reflectance; In the corrected hyperspectral image, the whole area is selected as the region of interest, and the average reflectance of all pixels in the region at each band is calculated as the average reflectance spectrum of the sample. The average reflectance spectrum is preprocessed, and based on the preprocessed spectral data, a grading model for the degree of browning of the outer peel and a discrimination model for whether the inner pulp is browned are constructed. The model accuracy was evaluated using confusion matrix and accuracy, and the optimal algorithm model for different detection tasks was selected. S4: Based on the aforementioned optimal algorithm model, further feature optimization and fusion modeling are performed: Specifically, for the grading of different browning degrees of the fruit's outer peel, the preprocessed spectral data is dimensionality-reduced using principal component analysis, and principal component scores are extracted as features. Simultaneously, image features are extracted from the ROI regions of fruits with different browning degrees. The dimensionality-reduced spectral data and the extracted image features are fused to form a fused feature vector, and a grading model for the browning degree of the outer peel is further constructed based on the fused feature vector. To identify browning of the fruit pulp inside, based on the preprocessed spectral data, key variables are extracted by screening for characteristic wavelengths to obtain the characteristic wavelengths of the spectrum. The obtained characteristic wavelength data of the spectrum is then used to further construct a model for identifying browning inside the fruit.
2. The method according to claim 1, characterized in that, In step S2, the operating wavelength of the hyperspectral imaging system during data acquisition is set to 400-1000 nm.
3. The method according to claim 1, characterized in that, In step S2, the browning level is determined as follows: Image processing software was used to calculate the percentage of browning area on the peel. Based on the percentage, fruit samples with different degrees of browning were divided into grades 0, 1 and 2. Grade 0 had a browning area percentage of 0, grade 1 had a browning area percentage of <25%, and grade 2 had a browning area percentage of ≥25%. The pulp was examined by cutting it open to see if it had turned brown. Samples that did not turn brown were grade 0, and samples that turned brown were grade 1.
4. The method according to claim 1, characterized in that, In step S3, the method for performing the reflection spectrum preprocessing is one or more combinations of standard normal variable transformation, first derivative, and second derivative.
5. The method according to claim 1, characterized in that, In step S3, the grading model for the degree of browning of the outer peel and the discrimination model for whether the inner pulp is browned are constructed as follows: the samples are divided into training set and prediction set in a 3:1 ratio, and BP neural network, support vector machine and random forest algorithm are used.
6. The method according to claim 1, characterized in that, In step S4, the method for feature wavelength selection includes a competitive adaptive weighting algorithm and a continuous projection algorithm.
7. The method according to claim 1, characterized in that, In step S4, the image features include texture features and color features based on the gray-level co-occurrence matrix.
8. The method according to claim 7, characterized in that, When extracting texture features, a step size of d=1 is preset, and gray-level co-occurrence matrices are constructed along the four directions of 0°, 45°, 90° and 135° respectively. Based on the matrices constructed in each direction, the corresponding texture feature parameters are calculated. Then, the mean of each texture feature parameter obtained in the four directions is calculated to obtain the final texture feature vector.
9. The method according to claim 7, characterized in that, The texture feature parameters include mean, standard deviation, contrast, dissimilarity, homogeneity, second moment of angle, energy, maximum probability, and entropy; the color features are 9-dimensional statistical features based on multi-color space fusion, consisting of the following components: R channel features, G channel features, B channel features, HSV space hue features, HSV space saturation features, HSV space brightness features, HSI space hue features, HSI space saturation features, and HSI space intensity features.
10. The method according to claim 9, characterized in that, The 9-dimensional statistical features based on multi-color space fusion are constructed as follows: The original ROI image is transformed from the RGB color space to the HSV and HSI color spaces respectively; and the average value of the pixel component in each channel of the RGB, HSV and HSI color spaces is calculated respectively.