A method for detecting SSC and pH values ​​of red grapes and classifying their maturity based on hyperspectral imaging

Through hyperspectral imaging technology and model construction, the rapid and accurate problems of red-leaf SSC and pH detection are solved, and the maturity classification of red-leaf fruits is realized, which improves the accuracy of orchard management and yield prediction.

CN118486008BActive Publication Date: 2024-12-03QINGDAO UNIV OF SCI & TECH +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410438824.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-12
Publication Date
2024-12-03
Estimated Expiration
2044-04-12

AI Technical Summary

Technical Problem

The prior art lacks fast, non-destructive and accurate methods to detect SSC and pH values ​​of red extract fruits, especially during growth, and lacks research on the use of hyperspectral imaging technology combined with pseudo-color image processing to achieve red extract maturity classification. .

Method used

Hyperspectral imaging technology is used to collect hyperspectral image information of red-elevated samples. Through preprocessing and feature wavelength extraction, a red-elevated SSC detection model, pH detection model and maturity classification model are constructed, and principal component regression algorithm and partial least squares regression are used. Algorithms, extreme learning machines and support vector machines are used to construct and evaluate models to realize rapid non-destructive detection and maturity classification of red-raising SSC and pH values.

Benefits of technology

It realizes rapid non-destructive detection and distribution visualization of red extract SSC and pH values, accurately classifies red extract fruit ripening, and improves the accuracy of intelligent management and yield prediction of orchards.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118486008B_ABST
    Figure CN118486008B_ABST
Patent Text Reader

Abstract

The present invention provides a method for detecting SSC and pH values ​​of red grapes and classifying maturity based on hyperspectral imaging, including: collecting red grape samples and classifying maturity; collecting hyperspectral image information of red grape samples; measuring SSC and pH values ​​of red grape samples after collecting hyperspectral image information; preprocessing and extracting characteristic wavelengths of hyperspectral image information of red grape samples; determining the construction method and evaluation index of red grape SSC detection model, red grape pH detection model and red grape maturity classification model; constructing optimal detection model of red grape SSC and pH value and optimal classification model of maturity; using the constructed detection model to visualize the distribution of SSC and pH value of red grape fruit and classify the maturity of red grapes. The scheme of the present invention realizes rapid non-destructive detection and distribution visualization of SSC and pH value of red grapes in the growth period, as well as classification and discrimination of red grapes at three maturity levels based on hyperspectral imaging.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of food safety, and in particular to a method for detecting SSC and pH values ​​of red grapes and classifying maturity based on hyperspectral imaging. Background Art

[0002] Red grapes are rich in nutrition and delicious, and are widely loved by people. The SSC and pH values ​​in red grapes determine the flavor of red grapes, and thus determine their marketing value and product competitiveness. The SSC and pH values ​​in red grapes change continuously during the ripening process, so SSC and pH values ​​can be used as important indicators for evaluating the ripening stage of the fruit.

[0003] The traditional method of testing the SSC and pH values ​​of red grapes is to conduct destructive sampling, which is time-consuming and labor-intensive, and can only be tested by sampling. Therefore, it is very important to achieve rapid, non-destructive and accurate testing of red grapes. Hyperspectral imaging technology can achieve rapid and non-destructive testing of the SSC and pH values ​​of red grapes. The use of this technology can accurately grasp the SSC and pH indexes and distribution patterns of fruits during their growth period, which is of great significance for the future intelligent management of orchards, prediction of fruit yield and maturity, and fruit quality testing.

[0004] Hyperspectral imaging technology can simultaneously obtain image information and spectral information of samples. It has been widely used in quality and maturity detection of agricultural products such as fruits and vegetables. However, most existing studies focus on the detection of internal quality of fruits after harvest, while there are relatively few studies on the use of hyperspectral technology to detect the SSC and pH values ​​of red grapes during the growth period. There is a lack of research on the use of hyperspectral technology to establish a model combined with pseudo-color image processing technology to realize the visualization of the SSC and pH value distribution of red grapes. There is even less research on the use of hyperspectral imaging technology to classify the maturity of red grapes. Summary of the invention

[0005] In order to solve the problems existing in the prior art, the present invention provides a method for detecting SSC and pH value of red grapes and classifying maturity based on hyperspectral imaging, comprising the following steps:

[0006] Step 1, collecting and numbering red grape samples in the growth period, classifying and preserving the collected red grape samples according to maturity;

[0007] Step 2: Build a hyperspectral imaging system and use the hyperspectral imaging system to collect hyperspectral image information of red grape samples;

[0008] Step 3, measuring the SSC and pH values ​​of the red grape samples after collecting the hyperspectral image information, and dividing the red grape samples into a calibration set and a prediction set;

[0009] Step 4, preprocessing the hyperspectral image information of the red grape sample and extracting characteristic wavelengths;

[0010] Step 5, according to the characteristics of red grape during growth, determine the construction method and evaluation index of red grape SSC detection model, red grape pH detection model and red grape maturity classification model;

[0011] Step 6, using the red grape SSC detection model and red grape pH detection model construction method determined in step 5, constructing a red grape SSC detection model and a red grape pH detection model based on the characteristic wavelength of the red grape sample, the SSC of the red grape sample, and the pH measurement results, and using the red grape SSC detection model and red grape pH detection model evaluation indicators determined in step 5 to perform model evaluation, and determine the optimal detection model for red grape SSC and pH value;

[0012] Step 7, using the red grape maturity classification model construction method determined in step 5, constructing a red grape maturity classification model based on the characteristic wavelength of the red grape sample and the maturity classification result of the red grape sample, and using the red grape maturity classification model evaluation index determined in step 5 to perform model evaluation, and determine the optimal classification model for red grape maturity;

[0013] Step 8: Visualize the distribution of SSC and pH values ​​of red grapes using the optimal detection model of red grape SSC and pH values ​​obtained in step 6, and classify the maturity of red grapes using the optimal classification model of red grape maturity obtained in step 7.

[0014] Optionally, the step 1 includes:

[0015] Based on the flowering time of red grapes, red grape samples were collected every 5 days, with 10 bunches of red grapes sampled each time, for a total of 12 times;

[0016] Six grapes of similar size and without damage were selected from each bunch of grapes, totaling 720 grape samples. The grape samples were divided into maturity 1, 2 and 3 according to experience, with 240 grapes for each maturity; 360 grapes were used for SSC index detection, with 120 grapes for each maturity; the remaining grapes were used as pH value samples, with 360 grapes used for pH value index detection;

[0017] The red grape samples were numbered and stored in a constant temperature and humidity chamber set at 22±1° C. and 65% relative humidity in the order of the numbers.

[0018] Optionally, the hyperspectral imaging system is composed of main components such as a hyperspectral imaging spectrometer, a CCD camera, a halogen lamp light source, a screw displacement platform, etc. It can collect spectral information of 520 wavelength points in the spectral wavelength range of 391-1043nm with a resolution of 2.8nm. The entire collection system is placed in a dark box.

[0019] Optionally, step 3 includes:

[0020] The juice of the red grape sample with the hyperspectral image information collected was squeezed and collected into a centrifuge tube with a volume of 10 ml, the juice was dropped into an Abel refractometer to measure the SSC value, and the probe of the pH meter was inserted into the juice to measure the pH value;

[0021] The SPXY method was used to divide the red grape samples into a calibration set and a prediction set.

[0022] Optionally, step 4 includes:

[0023] A standard white board is placed on the acquisition platform to obtain a standard white board image W. A black cover is used to completely cover the camera lens to obtain a dark reference image B. Multiple red grape samples are placed on the acquisition platform to obtain the original red grape hyperspectral image R0. The corrected hyperspectral image Rc is obtained according to formula (1), as follows:

[0024]

[0025] ENVI 4.7 software was used to analyze the spectral characteristics of the red grape sample and background in the hyperspectral image, and the spectral reflectance map of the red grape sample area and background was obtained;

[0026] According to the spectral reflectance diagram of the red grape sample area and the background, a grayscale image at the point where the difference between the red grape sample area and the background reflectance is the largest is determined to extract the red grape sample area;

[0027] The hyperspectral image is processed by Otsu threshold segmentation method to obtain a binary image, and the binary image is subjected to median filtering, open operation and small area removal to obtain a mask template. The mask template is used to perform mask operation on the grayscale image to sequentially segment the red grape sample areas in the hyperspectral image and sort them according to the area of ​​the segmented single red grape samples, and the original spectral information of each segmented red grape sample area is sequentially extracted;

[0028] The CARS algorithm, SPA algorithm, GA algorithm and IRIV algorithm are used to extract characteristic wavelengths from the original spectral information.

[0029] Optionally, step 5 includes:

[0030] The principal component regression algorithm PCR and the partial least squares regression algorithm PLSR were selected to construct the red grape SSC detection model and the red grape pH detection model, and the calibration set correlation coefficient Rc and root mean square error RMSEC, the prediction set correlation coefficient Rp and root mean square error RMSEP, and the residual prediction deviation RPD were selected to evaluate the model performance;

[0031] The extreme learning machine (ELM) and support vector machine (SVM) were selected to construct the red grape maturity classification model, and the classification accuracy and confusion matrix of the calibration set and prediction set were selected to evaluate the model performance.

[0032] Optionally, step 6 includes:

[0033] The RAW-PCR and RAW-PLSR models of red grape SSC and pH were constructed based on the original spectral information of red grape samples, the SSC of red grape samples and the pH measurement results.

[0034] The performance of the PCR model of red grape SSC and pH value and the PLSR model of red grape SSC and pH value were evaluated according to the calibration set correlation coefficient Rc and the prediction set correlation coefficient Rp, and it was determined that the partial least squares regression algorithm PLSR was used to construct the red grape SSC detection model and the red grape pH detection model;

[0035] The RAW-CARS-PLSR model, RAW-SPA-PLSR model, RAW-GA-PLSR model and RAW-IRIV-PLSR model of red grape SSC and pH value were constructed using the characteristic wavelengths extracted from the original spectral information, the SSC of red grape samples and the pH measurement results.

[0036] According to the calibration set correlation coefficient Rc and root mean square error RMSEC, the prediction set correlation coefficient Rp and root mean square error RMSEP, and the residual prediction deviation RPD, the performance of the RAW-CARS-PLSR model, RAW-SPA-PLSR model, RAW-GA-PLSR model and RAW-IRIV-PLSR model for red grape SSC and pH values ​​was evaluated, and the RAW-IRIV-PLSR model for red grape SSC and pH values ​​was determined to be the optimal detection model for red grape SSC and pH values.

[0037] Optionally, step 7 includes:

[0038] According to the original spectrum information of red grape samples, the characteristic wavelengths extracted from the original spectrum information by IRIV algorithm and the maturity classification results of red grape samples, RAW-SVM model, RAW-IRIV-SVM model, RAW-ELM model and RAW-IRIV-ELM model for red grape maturity classification were constructed;

[0039] According to the classification accuracy and confusion matrix of the calibration set and prediction set, the performance of the RAW-SVM model, RAW-IRIV-SVM model, RAW-ELM model and RAW-IRIV-ELM model for red grape maturity classification was evaluated, and the RAW-IRIV-ELM model for red grape maturity classification was determined to be the optimal classification model for red grape maturity.

[0040] After adopting the above technical solution, the beneficial effects of the present invention are:

[0041] 1. The original spectral information of red grape samples during the growth period was collected by hyperspectral imaging technology, and the SSC and pH values ​​of red grape samples during the growth period were detected by physical and chemical methods. The optimal detection model of red grape SSC and pH values ​​based on IRIV and PLSR algorithms was established, and the rapid non-destructive detection and distribution visualization of SSC and pH values ​​of red grapes during the growth period were realized;

[0042] 2. The original spectral information of red grape samples during the growing period was collected through hyperspectral imaging technology, and the red grapes during the growing period were divided into three maturity levels. An optimal classification model for red grape maturity based on IRIV and ELM algorithms was established, and the classification and discrimination of red grapes at three maturity levels was realized. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0044] Figure 1 A spectral reflectance graph of a red grape sample and a background in a hyperspectral image collected by an embodiment of the present invention;

[0045] Figure 2 1 is a diagram of the process of extracting the original spectral information of a red grape sample according to an embodiment of the present invention, wherein (A) to (E) are respectively the hyperspectral original image, binary image, mask template, label sorting and original spectral information of the red grape sample;

[0046] Figure 3 The embodiment of the present invention uses the IRIV algorithm to extract the characteristic wavelength map;

[0047] Figure 4 This is a detection effect diagram of the optimal detection model of red grape SSC and pH value according to an embodiment of the present invention;

[0048] Figure 5 The diagram is a result diagram of the classification of red grape maturity of the prediction set of the RAW-IRIV-ELM model of an embodiment of the present invention, wherein (A) and (B) are a scatter plot of the predicted values ​​and true values ​​of the prediction set by the RAW-IRIV-ELM model and a confusion matrix of the predicted values ​​of the prediction set by the RAW-IRIV-ELM model, respectively;

[0049] Figure 6 This is a visualization distribution diagram of the SSC of red grapes according to an embodiment of the present invention, wherein (A) and (B) are the hyperspectral original image and the SSC visualization distribution of the red grape sample, respectively;

[0050] Figure 7: This is a visualized distribution diagram of pH of red grapes according to an embodiment of the present invention, wherein (C) and (D) are the hyperspectral original image and the visualized distribution of pH of the red grape sample, respectively. DETAILED DESCRIPTION

[0051] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0052] Red grapes were picked from a vineyard for an experiment. The steps for testing the SSC and pH values ​​of red grapes and the maturity classification are as follows:

[0053] Step 1: Based on the flowering time of red grapes, red grape samples were collected every 5 days, with 10 bunches of red grapes sampled each time, for a total of 12 times;

[0054] In order to ensure the consistency and accuracy of the maturity classification of red grape samples, 6 red grapes of similar size and without damage were selected from each bunch of red grapes, totaling 720 red grape samples. Three orchard owners divided the red grape samples into maturity 1, 2 and 3 according to certain principles and combined with the experience of fruit farmers, with 240 grapes for each maturity; 360 grapes were used for SSC index detection, with 120 grapes for each maturity, and the remaining red grapes were used as pH value samples, with 360 grapes used for pH value index detection;

[0055] To ensure the validity of the experiment, red grape samples were picked on the day of the experiment, numbered, and stored in a constant temperature and humidity chamber set at 22±1°C and 65% relative humidity in the order of their numbers.

[0056] Step 2: Build a hyperspectral imaging system and use it to collect hyperspectral image information of red grape samples. The hyperspectral imaging system consists of a hyperspectral imaging spectrometer, a CCD camera, a halogen light source, a screw displacement platform and other main components. The spectral information of 520 wavelength points with a spectral wavelength range of 391-1043nm can be collected, and the resolution is 2.8nm. The entire collection system is placed in a dark box. During the experiment, the parameters of the hyperspectral imaging system are set as follows: the platform moving speed is 1.7mm / s, the moving range is 0-245mm, the camera exposure time is 0.15s, and the distance between the lens and the sample is 420mm. ;

[0057] Step 3, determining the SSC and pH values ​​of the red grape samples by physical and chemical methods, squeezing the juice of the red grape samples after collecting the hyperspectral image information and collecting it in a centrifuge tube with a volume of 10 ml, dropping the juice into an Abel refractometer to measure the SSC value, and inserting the probe of the pH meter into the juice to measure the pH value;

[0058] The SPXY method was used to divide the red grape samples into a calibration set and a prediction set. Table 1 shows the statistical results of SSC and pH values ​​of the calibration set and the prediction set. The divided samples should have the following characteristics: 1) The sample index range of the calibration set should exceed the sample index range of the prediction set; 2) The number of samples in the calibration set is large enough to determine the mathematical relationship between the spectral information and the sample index, and to ensure the accuracy of the mathematical relationship between the two; 3) The sample index values ​​in the calibration set are evenly distributed.

[0059] Table 1

[0060]

[0061] 360 samples were collected for each indicator, and the SPXY sample set division method was used to divide them into 270 calibration set samples and 90 prediction set samples at a ratio of 3:1. As can be seen from Table 1, the SSC distribution range of the calibration set is 4.5-19.0°Brix, the SSC distribution range of the prediction set is 4.75-18.0°Brix, and the standard deviations of the calibration set, prediction set and total sample set are 3.28, 3.63 and 3.37, respectively, with close values; the pH value distribution range of the calibration set is 2.68-4.62, and the pH value distribution range of the prediction set is 2.70-4.51. The standard deviations of the calibration set, prediction set and total sample set are 0.53, 0.54 and 0.53, respectively, with close values. The SSC and pH value distribution ranges of the calibration set are larger than those of the prediction set. Therefore, the SPXY method is suitable for the division of the sample set of this experiment and has achieved good results.

[0062] Step 4: To eliminate the influence of noise, the hyperspectral image needs to be calibrated in black and white. A standard white board is placed on the acquisition platform to obtain a standard white board image W. A black cover is used to completely cover the camera lens to obtain a dark reference image B. Multiple red grape samples are placed on the acquisition platform to obtain the original hyperspectral image R0 of red grapes. The corrected hyperspectral image Rc is obtained according to formula (1), as follows:

[0063]

[0064] The spectral characteristics of the red grape sample and background in the hyperspectral image were analyzed using ENVI 4.7 software to obtain the spectral reflectance map of the red grape sample area and the background, as shown in Figure 2. Figure 1 As shown, Figure 1The solid curve in the middle is the spectral reflectance curve of the red grape sample, the dotted curve is the spectral reflectance curve of the background, and the dotted straight line is the position of the maximum difference between the two, and the corresponding wavelength is 726.6nm. Therefore, the grayscale image at 726.6nm is selected to extract the red grape sample area, as shown in Figure 2 (A)

[0065] The hyperspectral image is processed using the Otsu threshold segmentation method to obtain a binary image, such as Figure 2 (B) shows; the binary image is subjected to median filtering, opening operation and small area removal to obtain a mask template, as shown in Figure 2 (C) As shown; the grayscale image is masked using a mask template to sequentially segment the red grape sample areas in the hyperspectral image and sort them according to the area of ​​the segmented individual red grape samples, as shown in Figure 2 As shown in (D), the original spectral information of each segmented red grape sample area is extracted in turn, such as Figure 2 (E)

[0066] Each pixel in a hyperspectral image is composed of 256 spectral features, and there is always redundancy between these features, which increases the amount of modeling calculations. Therefore, it is necessary to choose a reasonable feature wavelength selection method to eliminate redundancy and improve the stability of the model.

[0067] This embodiment uses the CARS algorithm, SPA algorithm, GA algorithm and IRIV algorithm to extract characteristic wavelengths from the original spectral information. The continuous projection algorithm (SPA) solves the problem of information overlap and non-overlapping and reduces redundancy; the competitive adaptive reweighted sampling algorithm (CARS) uses the Monte Carlo model to sample and continuously iterates and optimizes; the genetic algorithm (GA) simulates Darwin's theory of biological evolution and is a method for searching for the optimal solution by simulating the natural evolution process; the iterative information retention variable (IRIV) method fully combines the joint effect of different wavelength variables, divides the different wavelength variables according to importance according to the effect of the model, and retains the information variables that are beneficial to the model.

[0068] Step 5, select the principal component regression algorithm PCR and the partial least squares regression algorithm PLSR to construct the red grape SSC detection model and the red grape pH detection model;

[0069] The PCR algorithm seeks to replace some original indicators with certain correlation (such as P indicators) and recombines them into a new set of unrelated comprehensive indicators. It can eliminate multiple covariances in the regression model and reduce the dimension of the data space. The PCR algorithm only extracts the principal components based on the independent variables. The PLSR algorithm combines the advantages of correlation analysis, principal component analysis and multivariate linear regression. In the calculation process, it considers the influence of the independent variables (spectral data) and the dependent variable matrix (chemical reference value) on the model at the same time. It can better handle the covariance of the data, and can better utilize the correlation between the data information and the components of the sample to be tested. Better results can be obtained in the modeling of complex components.

[0070] Extreme learning machine (ELM) is a new algorithm for single hidden layer feedforward neural network. The weights of input layer and hidden layer and thresholds of hidden layer neurons are randomly generated during operation. The optimal solution can be automatically obtained by setting the number of neurons in hidden layer. In this embodiment, the number of neurons in hidden layer is selected as 20000, and the activation function is selected as hardlim function. Support vector machine (SVM) classification model is a commonly used analysis method in spectral analysis, which is widely used in regression and classification problems. The SVM model of this embodiment selects RBF kernel function and uses cross validation method to find the best c and g parameters. The c parameter is 512 and the g parameter is 0.036.

[0071] This embodiment selects the correction set correlation coefficient Rc and root mean square error RMSEC, the prediction set correlation coefficient Rp and root mean square error RMSEP, and the residual prediction deviation RPD to evaluate the model performance; and selects the classification accuracy and confusion matrix of the correction set and the prediction set to evaluate the model performance.

[0072] Step 6. According to the original spectral information of the red grape sample, the SSC of the red grape sample and the pH measurement results, the RAW-PCR and RAW-PLSR models of the SSC and pH value of the red grape were constructed. The model effects are shown in Table 2. As can be seen from Table 2, the Rc and Rp of the RAW-PCR and RAW-PLSR models of the SSC and pH value of the red grape are greater than those of the RAW-PCR model. Therefore, the effect of the PLSR model is better than that of the PCR model, and the PLSR model is selected for modeling.

[0073] Table 2

[0074]

[0075] The correlation coefficients of the calibration set and prediction set of SSC and pH values ​​of the PLSR model using the original spectral information are relatively small, indicating that the detection performance of the model is not good and the number of wavelengths is large. It is necessary to further extract characteristic wavelengths to improve the stability and prediction performance of the model.

[0076] The characteristic wavelengths extracted from the original spectral information by the CARS algorithm, SPA algorithm, GA algorithm and IRIV algorithm and the SSC measurement results of the red grape samples were used to construct the RAW-CARS-PLSR model, RAW-SPA-PLSR model, RAW-GA-PLSR model and RAW-IRIV-PLSR model of red grape SSC. The model effects are shown in Table 3. As can be seen from Table 3, in the constructed red grape SSC model, the number of characteristic wavelengths extracted by the GA algorithm is 56, and the residual prediction deviation RPD of the model established using the characteristic wavelengths extracted by the GA algorithm is 3.30, which is not much different from the residual prediction deviation RPD of the model established using the characteristic wavelengths extracted by the CARS algorithm. The residual prediction deviation RPD of the model established using the characteristic wavelengths extracted by the SPA algorithm is 3.03, and the detection performance is the worst. The calibration set correlation coefficient Rc of the model constructed using the characteristic wavelengths extracted by the IRIV algorithm is 0.96, the prediction set correlation coefficient Rp is 0.96, and the number of extracted characteristic wavelengths is 33 (as shown in Table 3). Figure 3 (As shown in (A)), accounting for 6.35% of the original number of spectra, the residual prediction deviation RPD is 3.55, and the detection performance of the model is the best.

[0077] Table 3

[0078]

[0079] The characteristic wavelengths extracted from the original spectral information by CARS algorithm, SPA algorithm, GA algorithm and IRIV algorithm and the pH measurement results of red grape samples were used to construct the RAW-CARS-PLSR model, RAW-SPA-PLSR model, RAW-GA-PLSR model and RAW-IRIV-PLSR model of red grape pH value. The RPD of the model constructed by the characteristic wavelengths extracted by the GA algorithm was 3.16, and the detection performance was the worst. The calibration set correlation coefficient Rc of the model constructed by the characteristic wavelengths extracted by the IRIV algorithm was 0.96, the prediction set correlation coefficient Rp was 0.96, and the number of characteristic wavelengths was 27 (such as Figure 3 (B)), accounting for 5.19% of the original number of spectra, and the residual prediction deviation RPD is 3.80, and the detection performance of the model is the best.

[0080] In summary, the model evaluation parameters of the PLSR model of red grape SSC and pH value were improved by using the IRIV algorithm to extract characteristic wavelengths. Therefore, the optimal detection model of red grape SSC and pH value was the RAW-IRIV-PLSR model. The detection performance of the optimal detection model of red grape SSC and pH value is shown in Figure 2. Figure 4 shown.

[0081] Step 7. According to the original spectral information of the red grape samples, the characteristic wavelengths extracted from the original spectral information by the IRIV algorithm and the maturity classification results of the red grape samples, the RAW-SVM model, the RAW-IRIV-SVM model, the RAW-ELM model and the RAW-IRIV-ELM model for maturity classification of red grapes are constructed. The model effects are shown in Table 4. As can be seen from Table 4, the RAW-IRIV-ELM model has the highest accuracy. The classification accuracy of the prediction set of the RAW-IRIV-ELM model is 97.037%. There are 270 red grape samples in the calibration set, of which 8 samples are misclassified: 5 samples of maturity 1 are misclassified as maturity 2, and 3 samples of maturity 2 are misclassified as maturity 3; the classification results of the prediction set of the RAW-IRIV-ELM model are shown in Table 4. Figure 5 As shown in the figure, the classification accuracy of the prediction set of the RAW-IRIV-ELM model is 96.667%. There are 90 samples in the correction set, of which 3 samples are misclassified: 2 samples of maturity 1 are misclassified as maturity 2; 1 sample of maturity 2 is misclassified as maturity 3. From the classification results of the RAW-IRIV-ELM model, it can be seen that when judging the maturity stage, samples of maturity 1 and maturity 2 are easily confused with each other, while samples of maturity 2 and maturity 3 are relatively easy to judge. The main reason for the misjudgment is that the samples were collected 5 days apart, and it is difficult to distinguish samples collected in a short time. The samples with a small collection time difference have little difference in color and size, and it is difficult to distinguish them only by appearance features. The use of hyperspectral imaging technology to dynamically classify the maturity of red grapes during the growth process has achieved good results.

[0082] Table 4

[0083]

[0084] Step 8, using the RAW-IRIV-PLSR model to process the hyperspectral image of the red grape sample, obtain the SSC and pH values ​​of each pixel in the image and generate an SSC and pH distribution map;

[0085] like Figure 6 As shown, blue represents the lowest SSC value of 0°Brix, and red represents the highest SSC value of 20°Brix. SSC increases gradually from blue to red. Figure 6It can be seen that in maturity 1, the red grapes of No. 1, No. 3 and No. 5 are green in color and relatively immature. The SSC pseudo-color distribution map shows that there are relatively more blue pixels, indicating that the SSC content is low. In maturity 3, the surface color of No. 11-15 is dark red and relatively mature. The SSC pseudo-color distribution map shows that there are relatively more red pixels, indicating that the SSC content is high. From the data analysis of the three maturity levels, the red red grape samples have relatively high SSC values, while the cyan red grape samples have relatively low SSC values, which confirms the rationality of the internal SSC index judged by the appearance color. However, the color of No. 7 is similar to that of No. 6 and No. 9, but the internal SSC value is lower than that of No. 6 and No. 9, which proves the limitation of judging the SSC index only by color. As the red grape matures, the SSC value increases, which is consistent with the actual experimental results determined by actual chemical measurements, thus proving the rationality of SSC visualization in red grape samples. Analysis of a single sample shows that the SSC value in the middle of the red grape is relatively low, while the SSC value near the epidermis is relatively high, which is related to the elliptical shape of the sample, resulting in light aggregation, making the illumination in the middle stronger and affecting the modeling.

[0086] like Figure 7 As shown, blue represents the lowest pH value of 0, red represents the highest pH value of 5, and SSC increases gradually from blue to red. Figure 7 It can be seen that in maturity 3, the surface color of red grape samples No. 11-15 is dark red, which is relatively mature. The pseudo-color distribution map of pH value shows that there are relatively more red pixels, indicating a higher pH value. From the data analysis of the three maturity levels, the pH value of red grape samples is relatively high, and the pH value of cyan samples is relatively low, which confirms the rationality of judging the internal pH value by appearance color. However, the color of No. 9 is similar to that of No. 8 and No. 10, but the internal pH value is lower than that of No. 8 and No. 10, which proves the limitation of judging the pH value only by color. As the red grapes mature, the pH value increases, which is consistent with the actual experimental results determined by actual chemical measurements, thus proving the rationality of pH visualization in red grape samples. The analysis of a single sample shows that the pH value in the middle of the red grape is relatively low, and the pH value close to the epidermis is relatively high. This may be related to the core inside the fruit, or it may be related to the elliptical shape of the sample. The light in the middle position is more sufficient and affects the modeling.

[0087] Although the present invention has been disclosed as above by way of embodiments, it is not intended to limit the present invention. Any person skilled in the art may make some changes and modifications without departing from the spirit and scope of the present invention. Therefore, the protection scope of the present invention shall be determined by the claims.

Claims

1. A method for detecting SSC and pH value and maturity classification of red grapes based on hyperspectral imaging. It is characterized in that The steps include: Step 1, collecting and numbering red grape samples in the growth period, classifying and preserving the collected red grape samples according to maturity; Step 2: Build a hyperspectral imaging system and use the hyperspectral imaging system to collect hyperspectral image information of red grape samples; Step 3, measuring the SSC and pH values ​​of the red grape samples after collecting the hyperspectral image information, and dividing the red grape samples into a calibration set and a prediction set; Step 4, preprocessing the hyperspectral image information of the red grape sample and extracting characteristic wavelengths; Step 5, according to the characteristics of red grape during growth, determine the construction method and evaluation index of red grape SSC detection model, red grape pH detection model and red grape maturity classification model; Step 6, using the red grape SSC detection model and red grape pH detection model construction method determined in step 5, constructing a red grape SSC detection model and a red grape pH detection model based on the characteristic wavelength of the red grape sample, the SSC of the red grape sample, and the pH measurement results, and using the red grape SSC detection model and red grape pH detection model evaluation indicators determined in step 5 to perform model evaluation, and determine the optimal detection model for red grape SSC and pH value; Step 7, using the red grape maturity classification model construction method determined in step 5, constructing a red grape maturity classification model based on the characteristic wavelength of the red grape sample and the maturity classification result of the red grape sample, and using the red grape maturity classification model evaluation index determined in step 5 to perform model evaluation, and determine the optimal classification model for red grape maturity; Step 8, using the optimal detection model of red grape SSC and pH value obtained in step 6 to visualize the distribution of SSC and pH value of red grape fruit, and using the optimal classification model of red grape maturity obtained in step 7 to classify the maturity of red grapes; The step 5 comprises: The principal component regression algorithm PCR and the partial least squares regression algorithm PLSR were selected to construct the red grape SSC detection model and the red grape pH detection model, and the calibration set correlation coefficient Rc and root mean square error RMSEC, the prediction set correlation coefficient Rp and root mean square error RMSEP, and the residual prediction deviation RPD were selected to evaluate the model performance; The extreme learning machine (ELM) and support vector machine (SVM) were used to construct the classification model of red grape maturity, and the classification accuracy and confusion matrix of the calibration set and prediction set were selected to evaluate the model performance. The step 6 comprises: The RAW-PCR and RAW-PLSR models of red grape SSC and pH were constructed based on the original spectral information of red grape samples, the SSC of red grape samples and the pH measurement results. The performance of the PCR model of red grape SSC and pH value and the PLSR model of red grape SSC and pH value were evaluated according to the calibration set correlation coefficient Rc and the prediction set correlation coefficient Rp, and it was determined that the partial least squares regression algorithm PLSR was used to construct the red grape SSC detection model and the red grape pH detection model; The RAW-CARS-PLSR model, RAW-SPA-PLSR model, RAW-GA-PLSR model and RAW-IRIV-PLSR model of red grape SSC and pH value were constructed using the characteristic wavelengths extracted from the original spectral information, the SSC of red grape samples and the pH measurement results. The performance of RAW-CARS-PLSR model, RAW-SPA-PLSR model, RAW-GA-PLSR model and RAW-IRIV-PLSR model of red grape SSC and pH value was evaluated according to the calibration set correlation coefficient Rc and root mean square error RMSEC, prediction set correlation coefficient Rp and root mean square error RMSEP, and residual prediction deviation RPD. The RAW-IRIV-PLSR model of red grape SSC and pH value was determined to be the optimal detection model of red grape SSC and pH value. The step 7 comprises: According to the original spectrum information of red grape samples, the characteristic wavelengths extracted from the original spectrum information by IRIV algorithm and the maturity classification results of red grape samples, RAW-SVM model, RAW-IRIV-SVM model, RAW-ELM model and RAW-IRIV-ELM model for red grape maturity classification were constructed; According to the classification accuracy and confusion matrix of the calibration set and prediction set, the performance of the RAW-SVM model, RAW-IRIV-SVM model, RAW-ELM model and RAW-IRIV-ELM model for red grape maturity classification was evaluated, and the RAW-IRIV-ELM model for red grape maturity classification was determined to be the optimal classification model for red grape maturity.

2. The method for detecting SSC and pH value of red grapes and classifying maturity based on hyperspectral imaging according to claim 1, It is characterized in that The step 1 comprises: Based on the flowering time of red grapes, red grape samples were collected every 5 days, with 10 bunches of red grapes sampled each time, for a total of 12 times; Six grapes of similar size and without damage were selected from each bunch of grapes, totaling 720 grape samples. The grape samples were divided into maturity 1, 2 and 3 according to experience, with 240 grapes for each maturity; 360 grapes were used for SSC index detection, with 120 grapes for each maturity; the remaining grapes were used as pH value samples, with 360 grapes used for pH value index detection; The red grape samples were numbered and stored in a constant temperature and humidity chamber set at 22±1° C. and 65% relative humidity in the order of the numbers.

3. The method for detecting SSC and pH value of red grapes and classifying maturity based on hyperspectral imaging according to claim 1, It is characterized in that The hyperspectral imaging system consists of a hyperspectral imaging spectrometer, a CCD camera, a halogen lamp light source, and a screw displacement platform. It can collect spectral information of 520 wavelength points in the spectral wavelength range of 391-1043nm with a resolution of 2.8nm. The entire collection system is placed in a dark box.

4. The method for detecting SSC and pH value of red grapes and classifying maturity based on hyperspectral imaging according to claim 1, It is characterized in that The step 3 comprises: The juice of the red grape sample with the hyperspectral image information collected was squeezed and collected into a centrifuge tube with a volume of 10 ml, the juice was dropped into an Abel refractometer to measure the SSC value, and the probe of the pH meter was inserted into the juice to measure the pH value; The SPXY method was used to divide the red grape samples into a calibration set and a prediction set.

5. The method for detecting SSC and pH value of red grapes and classifying maturity based on hyperspectral imaging according to claim 1, It is characterized in that The step 4 comprises: A standard white board is placed on the acquisition platform to obtain a standard white board image W. A black cover is used to completely cover the camera lens to obtain a dark reference image B. Multiple red grape samples are placed on the acquisition platform to obtain the original hyperspectral image R of red grapes. 0 , according to formula (1), the corrected hyperspectral image Rc is obtained as follows: ENVI 4.7 software was used to analyze the spectral characteristics of the red grape sample and background in the hyperspectral image, and the spectral reflectance map of the red grape sample area and background was obtained; According to the spectral reflectance diagram of the red grape sample area and the background, a grayscale image at the point where the difference between the red grape sample area and the background reflectance is the largest is determined to extract the red grape sample area; The hyperspectral image is processed by Otsu threshold segmentation method to obtain a binary image, and the binary image is subjected to median filtering, open operation and small area removal to obtain a mask template. The mask template is used to perform mask operation on the grayscale image to sequentially segment the red grape sample areas in the hyperspectral image and sort them according to the area of ​​the segmented single red grape samples, and the original spectral information of each segmented red grape sample area is sequentially extracted; The CARS algorithm, SPA algorithm, GA algorithm and IRIV algorithm are used to extract characteristic wavelengths from the original spectral information.