Nondestructive testing method for organic acid content of Korla pear
By collecting and processing visible near-infrared spectral data of Korla scented pears, combining unsupervised genetic multi-engine algorithms and artificial neural networks, a high-precision organic acid content prediction model was established, solving the problem of low detection accuracy of Korla scented pears, and realizing the Lossless and fast detection effect.
Patent Information
- Application Number
- CN202411173129.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-26
- Publication Date
- 2024-11-26
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The non-destructive detection accuracy of the organic acid content of Korla syrup is low. Traditional methods require the destruction of samples and are time-consuming and labor-intensive. It is difficult to achieve effective regression prediction in the existing visible near-infrared spectroscopy.
By collecting visible near-infrared spectral data of Korla scent, smooth preprocessing and feature wavelength screening are carried out, and combining unsupervised genetic multi-engine algorithms and artificial neural network regression model, a high-precision organic acid content prediction model is established.
It realizes high-precision non-destructive testing of the organic acid content of Korla pear, overcomes the low-precision and destructive problems of traditional methods, and has the advantages of fast, non-destructive, economical and environmental protection.
Smart Images

Figure CN119023599A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of agricultural product detection, in particular to a nondestructive detection method for agricultural products, and specifically to a nondestructive detection method for organic acid content of Korla fragrant pear. Background Art
[0002] Korla pear is a typical geographical indication agricultural product in Xinjiang. Due to the abundant sunlight in Xinjiang, its fruit is plump, nutritious, and sweet and sour, which makes it popular among consumers. The quality and flavor of Korla pear determine the business decisions of producers and the purchasing trends of consumers, and one of the most important indicators for measuring the quality and flavor of Korla pear is organic acid. The organic acid content of Korla pear is the most important indicator of taste sensory perception. The appropriate organic acid content can make Korla pear sweet but not greasy, sweet and sour. In addition, the organic acid of Korla pear is an important nutrient and has certain important active effects such as antioxidant, anti-aging and anti-inflammatory. Traditional methods for measuring organic acid content, such as indicator titration and acidity meter, require the destruction of samples, which consumes a lot of time and manpower and causes food waste. Visible near-infrared spectroscopy has attracted widespread attention in fruit quality detection because of its non-destructive, rapid, accurate and low-cost nature. The collected spectrum covers the Vis-NIR band from 650nm to 2500nm, including the vibration energy of many molecular groups of chemical components such as OH, CH, CO, etc. Therefore, by collecting the visible-near infrared spectrum of Korla pear, the differences in its internal chemical composition can be reflected, and combined with the quantitative regression model, the non-destructive prediction of the organic acid content of Korla pear can be achieved.
[0003] Quantitative regression modeling aims to establish the relationship between spectrum and fruit quality, so as to construct a regression model of fruit quality and realize quantitative prediction of its quality. At present, unlike the sugar content of citrus, it is difficult to achieve effective regression prediction of the visible near-infrared spectrum of organic acid content of Korla pear, resulting in low non-destructive detection accuracy. The main difficulty is that the organic acid content of Korla pear accounts for only less than 1% of the total mass of the fruit, and the content is low. The model cannot effectively learn the complex mapping between Korla pear spectral data and organic acids, so that the prediction accuracy is low and cannot be effectively used in production practice. Layer-by-layer spectral wavelength screening can effectively select the most important features for model accuracy prediction. By extracting these characteristic wavelengths, the complex mapping between spectrum and organic acids can be effectively learned by using the multi-layer structure and activation function of the artificial neural network regression model, thereby significantly improving the prediction accuracy of the model. Therefore, it is particularly necessary to achieve high-precision non-destructive detection of organic acid content in Korla pear by layer-by-layer spectral characteristic wavelength screening and establishing an artificial neural network quantitative regression model. Summary of the invention
[0004] In view of this, the present invention aims to provide a nondestructive detection method for the organic acid content of Korla fragrant pear in order to address the difficulty in high-precision nondestructive detection of the organic acid content of Korla fragrant pear, so as to achieve high-precision nondestructive detection of the organic acid content of Korla fragrant pear.
[0005] In order to achieve the above technical objectives, the technical solution adopted by the present invention is:
[0006] A nondestructive detection method for organic acid content of Korla fragrant pear, comprising:
[0007] Step 1) collecting Korla pear samples, collecting spectral data by performing visible near-infrared spectral transmission scanning on the surface of each sample, and then determining the organic acid content corresponding to each sample;
[0008] Step 2) performing smoothing preprocessing on the collected spectrum to generate full-wavelength spectrum data and forming a full-wavelength data set with the organic acid content of the sample, and splitting the full-wavelength data set into a training set and a prediction set;
[0009] Step 3) Using an unsupervised combined genetic multi-engine algorithm to screen the characteristic wavelengths of the training set. Further, integrating the characteristic wavelengths and the corresponding organic acid content to construct a characteristic wavelength training set;
[0010] Step 4) construct an artificial neural network regression model using the characteristic wavelength training set, use cross-validation and hyperparameter optimization to obtain the optimal hyperparameters of the model, reconstruct the artificial neural network regression model with the optimal hyperparameters, and use the prediction set as input and the corresponding organic acid content as output to achieve high-precision non-destructive prediction of the organic acid content of Korla pear.
[0011] As a preferred embodiment, preferably, the sample size of the Korla pear sample collected in step 1) is not less than 50, and the spectrum can be measured by a desktop or handheld spectrometer, with a band range of 450 to 2500nm visible light to near infrared band, and the spectrum measurement position needs to be as evenly distributed as possible around the fruit, and the number of spectra collected for each fruit is not less than 4. The organic acid content is determined by indicator titration or spectrophotometry, and the determination results are repeated independently for no less than 3 times.
[0012] As a preferred implementation, preferably, the smoothing preprocessing in step 2) includes SG smoothing, Gaussian spectrum smoothing, moving average spectrum smoothing, etc. The data set is split into a training set and a prediction set by random sampling, which basically conforms to the normal distribution.
[0013] As a preferred implementation, preferably, the unsupervised screening in step 3) further comprises the following sub-steps:
[0014] Step 3.1) Subjectively eliminate sample spectrum difference variables or variables to be eliminated by subjective analysis, and eliminate variables with a missing ratio of more than 10%;
[0015] Step 3.2) Calculate the variance of each variable and eliminate variables with variance less than 0.1;
[0016] Step 3.3) Calculate the Pearson correlation coefficient for each variable and eliminate variables with a Pearson correlation coefficient greater than 0.9;
[0017] As a preferred implementation, preferably, step 3) combines a genetic multi-engine algorithm to screen the characteristic wavelengths of the training set. This algorithm is implemented in R language and also includes the following sub-steps:
[0018] Step 3.5) Initialize the genetic algorithm and input the independent variable x and the dependent variable y;
[0019] Step 3.6) In the genetic algorithm, the number of iterations is specified by the iters parameter. Each iteration is a generation of the algorithm. The number of individuals in each generation is determined by the popSize parameter, that is, how many characteristic wavelength subsets there are in each generation;
[0020] Step 3.7) The pcrossover parameter sets the crossover probability, i.e. the probability that two individuals will cross over; the pmutation parameter sets the mutation probability, i.e. the probability that an individual will mutate;
[0021] Step 3.8) construct random forest and support vector machine models respectively. Use cross validation to evaluate the prediction performance of each characteristic wavelength and output the optimal characteristic wavelength subset respectively;
[0022] Step 3.9) constructing a characteristic wavelength data set by combining the characteristic wavelengths selected above with the corresponding organic acid contents;
[0023] As a preferred implementation, preferably, step 4) also includes evaluating the model accuracy as the determination coefficient (R 2 ) and root mean square error (RMSE), calculated using equations (1) and (2), respectively. 2 The closer it is to 1, the smaller the RMSE is, which means the higher the accuracy of the model;
[0024]
[0025] Among them, y obs To measure the organic acid content of Korla pear; pre To predict the organic acid content of Korla pear; n is the number of samples.
[0026] As a preferred implementation option, preferably, the step 3) applies commonly used 5-fold cross validation and grid search to obtain the optimal hyperparameters of the model.
[0027] As a preferred implementation, preferably, the sample size of the prediction set in step 4) is not less than 20% of the total sample size or the amount of new sample data collected is not less than 20% of the total sample size.
[0028] Compared with the existing method, the present invention has the following beneficial effects:
[0029] 1. A nondestructive detection method for organic acid content of Korla pear proposed by the present invention has the advantages of being fast, nondestructive, economical and environmentally friendly compared to the traditional destructive method for detecting organic acid in fruits. The nondestructive detection method established based on four steps realizes the regression of fruit organic acid components and has strong feasibility. In the process of establishing the prediction model, the training set is screened for characteristic wavelengths by unsupervised combination of genetic multi-engine algorithm, and then artificial neural network regression modeling is performed, which overcomes the deficiency that the traditional model cannot perform high-precision prediction of organic acids.
[0030] 2. The characteristic wavelength screening in the present invention screens the characteristic variables of the spectral data set after smoothing preprocessing through an unsupervised combination of genetic multi-engine algorithms for the training set. This method overcomes the problems of low model learning efficiency, unclear accuracy improvement effect and easy overfitting caused by high-dimensional and complex features of traditional wavelength screening algorithms. The selected characteristic wavelength plays an important role in the establishment of the rapid nondestructive detection model of organic acids. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the existing methods, the drawings required for use in the embodiments and 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 from these drawings without creative work.
[0032] Figure 1 This is a visible near-infrared spectrum of the Korla pear involved in the embodiments of the present invention;
[0033] Figure 2 20 characteristic wavelengths of visible and near infrared spectra of Korla pear selected in the embodiment of the present invention;
[0034] Figure 3 A scatter plot comparing the organic acid content of the Korla fragrant pear output and the actually measured organic acid content involved in the embodiment of the present invention;
[0035] Figure 4A scatter plot comparing the organic acid content of Korla fragrant pear output and the actually measured organic acid content in Comparative Example 1 of the present invention;
[0036] Figure 5 The visible near-infrared spectrum characteristic wavelength of the Korla fragrant pear selected in Comparative Example 2 of the present invention;
[0037] Figure 6 A scatter plot comparing the organic acid content of Korla fragrant pear output and the actually measured organic acid content in Comparative Example 2 of the present invention; Specific embodiments
[0038] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is particularly noted that the following embodiments are only used to illustrate the present invention, but are not intended to limit the scope of the present invention. Similarly, the following embodiments are only partial embodiments of the present invention rather than all embodiments, and all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present invention.
[0039] The flowchart of this embodiment scheme using visible near infrared spectroscopy to achieve high-precision nondestructive detection of organic acid content in Korla pear is as follows Figure 1 As shown, the specific method is as follows:
[0040] 1) 190 Korla pears were collected from orchards in Korla, Xinjiang. A desktop automated spectral acquisition system was used to perform visible-near infrared spectral transmission scanning on each sample. The organic acid content of each sample was then determined by indicator titration. Five spectra were collected for each Korla pear fruit, ranging from 640 to 950 nm, and the organic acid content was determined three times.
[0041] 2) Perform SG smoothing preprocessing on the collected visible near-infrared spectra to generate full-wavelength spectrum data and form a full-wavelength data set with the organic acid content of the sample, and split the full-wavelength data set into 80% training set and 20% prediction set;
[0042] 3) Use unsupervised combined genetic multi-engine algorithm to screen the characteristic wavelengths of the training set. Furthermore, integrate the characteristic wavelengths and the corresponding organic acid content to construct the characteristic wavelength training set;
[0043] 4) An artificial neural regression model was constructed using the characteristic wavelength training set, and the optimal hyperparameters of the model were obtained using five-fold cross validation and hyperparameter grid search. The artificial neural regression model was reconstructed with the optimal hyperparameters, and the prediction set was used as input and the corresponding organic acid content was used as output to achieve high-precision nondestructive detection of the organic acid content of Korla pear.
[0044] The algorithm flow and some R codes for characteristic wavelength screening of training sets using unsupervised combined genetic multi-engine algorithm are as follows:
[0045]
[0046]
[0047]
[0048]
[0049]
[0050] The original spectrum is Figure 1 As shown, the characteristic wavelength of the above genetic multi-engine algorithm is as follows Figure 2 As shown in the figure, the best hyperparameters after hyperparameter optimization and cross-validation are hidden_units = 1, penalty = 0.01, epochs = 50. The calculated model accuracy is as follows Figure 3 As shown, the R 2 =0.925, RMSE = 0.0320, R of the prediction set (new sample set) 2 =0.944, RMSE=0.0252, which has higher prediction accuracy.
[0051] Specific comparative example 1
[0052] This comparative example scheme uses the full wavelength spectrum of visible near infrared spectrum to predict the organic acid content of Korla pear, aiming to demonstrate the advantages of this patented method. The specific method is as follows:
[0053] 1) 190 Korla pears were collected from orchards in Korla, Xinjiang. A desktop automated spectral acquisition system was used to perform visible-near infrared spectral transmission scanning on each sample. The organic acid content of each sample was then determined by indicator titration. Five spectra were collected for each Korla pear fruit, ranging from 640 to 950 nm, and the organic acid content was determined three times.
[0054] 2) Perform SG smoothing preprocessing on the collected visible near-infrared spectra to generate full-wavelength spectrum data and form a full-wavelength data set with the organic acid content of the sample, and split the full-wavelength data set into 80% training set and 20% prediction set;
[0055] 3) The artificial neural network regression model was constructed based on the training set, and the optimal hyperparameters of the model were obtained using five-fold cross validation and hyperparameter grid search. The artificial neural network regression model was reconstructed with the optimal hyperparameters, and the prediction set was used as input and the corresponding organic acid content was used as output.
[0056] The best hyperparameters after hyperparameter optimization and cross-validation are hidden_units = 1, penalty = 0.001, epochs = 150. The calculated model accuracy is as follows: Figure 4 As shown, the R 2 =0.806, RMSE = 0.0540, R of the prediction set (new sample set) 2 =0.783, RMSE =0.0504. Obviously, the method of the present invention has a much higher accuracy in predicting the organic acid content than that of Comparative Example 1.
[0057] Specific comparative example 2
[0058] This comparative scheme uses the competitive adaptive reweighted sampling (CRAS) algorithm to screen characteristic wavelengths to predict the organic acid content of Korla pear, aiming to demonstrate the advantages of this patented method. The specific method is as follows:
[0059] 1) 190 Korla pears were collected from orchards in Korla, Xinjiang. A desktop automated spectral acquisition system was used to perform visible-near infrared spectral transmission scanning on each sample. The organic acid content of each sample was then determined by indicator titration. Five spectra were collected for each Korla pear fruit, ranging from 640 to 950 nm, and the organic acid content was determined three times.
[0060] 2) Perform SG smoothing preprocessing on the collected visible near-infrared spectra to generate full-wavelength spectrum data and form a full-wavelength data set with the organic acid content of the sample, and split the full-wavelength data set into 80% training set and 20% prediction set;
[0061] 3) Competitive adaptive reweighted sampling (CRAS) was used to screen the characteristic wavelengths of the training set and integrate the characteristic wavelengths and the corresponding organic acid contents to form a characteristic wavelength dataset;
[0062] 4) The artificial neural network regression model was constructed based on the training set, and the optimal hyperparameters of the model were obtained using five-fold cross validation and hyperparameter grid search. The artificial neural network regression model was reconstructed with the optimal hyperparameters, and the prediction set was used as input and the corresponding organic acid content was used as output.
[0063] Competitive adaptive reweighted sampling algorithm wavelength screening algorithm process and part of the R code:
[0064]
[0065]
[0066] The best hyperparameters after hyperparameter optimization and cross-validation are hidden_units = 6, penalty = 0.001, epochs = 50, and the selected characteristic wavelengths are as follows Figure 5 As shown in the figure, the calculated model accuracy is Figure 6 As shown, the R 2 =0.852, RMSE = 0.0466, R of the prediction set (new sample set) 2 =0.821, RMSE =0.0458. CRAS is the most commonly used characteristic wavelength screening tool. Obviously, the method of the present invention has a higher accuracy in predicting the organic acid content than that of Comparative Example 2.
[0067] The above descriptions are only some embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Any equivalent device or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. The present invention discloses a nondestructive detection method for organic acid content of Korla pear, characterized in that: include: Step 1) collecting Korla pear samples, collecting spectral data by performing visible near-infrared spectral transmission scanning on the surface of each sample, and then determining the organic acid content corresponding to each sample; Step 2) performing smoothing preprocessing on the collected spectrum to generate full-wavelength spectrum data and forming a full-wavelength data set with the organic acid content of the sample, and splitting the full-wavelength data set into a training set and a prediction set; Step 3) using an unsupervised combined genetic multi-engine algorithm to screen the characteristic wavelengths of the training set, integrating the characteristic wavelengths and the corresponding organic acid content to construct a characteristic wavelength training set; The unsupervised screening includes the following sub-steps: Step 3.1) Subjective elimination: sample spectrum difference variables or variables to be eliminated by subjective analysis, eliminate missing variables according to missing ratio, and threshold sets the missing ratio limit; Step 3.2) Eliminate zero-variance variables and variables with the same value in all samples; Step 3.3) Eliminate variables with near-zero variance, few value levels, and variables with a few value levels accounting for the majority; Step 3.4) Eliminate highly correlated variables; The combined genetic multi-engine algorithm is implemented by R language and also includes the following sub-steps: Step 3.5) Initialize the genetic algorithm and input the independent variable x and the dependent variable y; Step 3.6) In the genetic algorithm, the number of iterations is specified by the iters parameter; Step 3.7) The pcrossover parameter sets the crossover probability, i.e. the probability that two individuals will cross over; the pmutation parameter sets the mutation probability, i.e. the probability that an individual will mutate; Step 3.8) constructing random forest and support vector machine models respectively, using cross validation to evaluate the prediction performance of each characteristic wavelength subset, and outputting the optimal characteristic wavelength subset respectively; Step 3.9) constructing a characteristic wavelength data set by combining the above selected characteristic wavelength subsets with the corresponding organic acid contents; Step 4) construct an artificial neural network regression model using the characteristic wavelength training set, use cross-validation and hyperparameter optimization to obtain the optimal hyperparameters of the model, reconstruct the artificial neural network regression model with the optimal hyperparameters, and use the prediction set as input and the corresponding organic acid content as output to achieve high-precision non-destructive prediction of the organic acid content of Korla pear.
2. A nondestructive detection method for organic acid content of Korla pear according to claim 1, characterized in that: The amount of Korla pear samples collected in step 1) is not less than 50, the spectrum can be measured by a desktop or handheld spectrometer, the band range is 450 to 2500nm visible light to near infrared band, the spectral measurement position needs to be as evenly distributed as possible around the fruit, the number of spectra collected for each fruit is not less than 4, the organic acid content is determined by indicator titration, and the measurement results are repeated independently for no less than 3 times.
3. A nondestructive detection method for organic acid content of Korla pear according to claim 1, characterized in that: The smoothing preprocessing in step 2) includes SG smoothing, Gaussian spectrum smoothing, moving average spectrum smoothing, etc. The data set is split into a training set and a prediction set by random sampling.
4. A nondestructive detection method for organic acid content of Korla pear according to claim 1, characterized in that: Step 4) The cross-validation methods include K-fold cross-validation, leave-one-out cross-validation, repeated random partitioning cross-validation, and leave-N cross-validation. The hyperparameter optimization methods may include grid search, random search, and Bayesian optimization.
5. A nondestructive detection method for organic acid content of Korla pear according to claim 1, characterized in that: Step 4) also includes the assessment of model accuracy as the coefficient of determination (R 2 ) and root mean square error (RMSE), calculated using equations (1) and (2), respectively. 2 The closer it is to 1, the smaller the RMSE is, which means the higher the accuracy of the model. Among them, y obs is the organic acid content of Korla pear; pre To predict the organic acid content of Korla pear; n is the number of samples.
6. A nondestructive detection method for organic acid content of Korla pear according to claim 1, characterized in that: Step 4) The sample size of the prediction set is not less than 20% of the total sample size.
Citation Information
Patent Citations
Method for effectively estimating carotenoid content of crop leaves based on hyperspectral technology
CN117092101A
Method for estimating nitrogen content of grassland vegetation leaves
CN118243644A
Apparatus and method for measuring and correlating characteristics of fruit with visible / near infra-red spectrum
WO2001069191A1
