A multi-chemical index prediction method based on similarity spectrum fitting

Through the similar spectral fitting method, the problems of unsatisfactory linear modeling and high model complexity in near-infrared spectral analysis of complex agricultural products such as tobacco are solved, and rapid and accurate prediction of multiple chemical indicators is achieved, improving prediction efficiency and accuracy. Suitable for tobacco analysis in different regions and varieties.

CN113971990BActive Publication Date: 2024-10-08CHINA TOBACCO ZHEJIANG IND CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111232351.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-22
Publication Date
2024-10-08
Estimated Expiration
2041-10-22

AI Technical Summary

Technical Problem

In the near-infrared spectrum analysis of complex agricultural products such as tobacco, the existing technology has problems such as unsatisfactory linear modeling results, high model complexity, and insufficient number of samples leading to inaccurate predictions, especially for substances from different regions, varieties, and grades, and Difficulty updating models quickly.

Method used

A multi-chemical index prediction method based on similar spectrum fitting is adopted. Through preprocessing and similarity calculation of near-infrared spectra, similar spectral segments are selected for fitting, the fitting values ​​of chemical indicators are calculated, and the absolute values ​​of the fitting coefficient and the detection value are used. Errors are screened to determine the optimal fitting coefficient and sample size to achieve rapid and accurate prediction of multiple chemical indicators.

Benefits of technology

It improves the prediction efficiency and accuracy of chemical indicators, avoids the fitting of multiple dissimilar spectra, reduces the dependence on sample size and parameter selection, and achieves prediction of multiple indicators at one time without the need for modeling one by one. It is suitable for new applications. Direct prediction of augmentation chemical indicators.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113971990B_ABST
    Figure CN113971990B_ABST
Patent Text Reader

Abstract

The invention discloses a method for predicting multiple chemical indicators based on similar spectrum fitting, comprising: (1) collecting near infrared spectra of multiple samples; (2) calculating the similarity between the selected target spectrum and other near infrared spectra; (3) under each value of N, for each target spectrum, selecting N near infrared spectra with the largest similarity to the target spectrum to fit the target spectrum, so as to determine N fitting coefficients; (4) using the N fitting coefficients to calculate the fitting value of each chemical indicator of each target spectrum, and calculating the absolute error between the fitting value and the detection value; (5) for each chemical indicator, calculating the average value of the absolute errors corresponding to all near infrared spectra as the target spectrum, and selecting the N corresponding to the minimum average value of the absolute error as the final determined value N0; (6) using the determined N0 to calculate the fitting value of each chemical indicator of the test sample according to steps (2) to (4). The method realizes the rapid and accurate prediction of multiple chemical indicators.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of near infrared spectroscopy and chemometrics, and in particular relates to a multi-chemical index prediction method based on similar spectrum fitting. Background Art

[0002] Near infrared spectroscopy is a fast, accurate and non-destructive detection technology. Near infrared spectroscopy mainly detects the double frequency and sum frequency absorption of hydrogen-containing group vibrations, which contains the composition information of most types of organic compounds and is very suitable for the detection of various complex mixtures. At present, the modeling of the main chemical components of tobacco leaves based on near infrared is mainly achieved through the partial least squares algorithm (PLS).

[0003] PLS is proposed to make up for the defects of least squares in calculating strong collinearity data. Consider a set of dependent variables Y and a set of independent variables X. When X has serious multiple correlation or the number of samples is less than the number of variables, the matrix X T The inversion of X will fail. PLS solves this problem by extracting components from X and Y in turn to ensure that the covariance between the components in X and Y is maximized, thereby achieving regression modeling, simplifying the data structure, and analyzing the correlation between the two groups of variables. It can effectively handle multivariate and collinearity problems and is very suitable for quantitative analysis of near-infrared spectroscopy.

[0004] Regarding the modeling of the main substances of complex agricultural products such as tobacco and Chinese medicinal materials, PLS has the following main defects. First, for substances from different regions, varieties, grades and with a wide range of content, the relationship between the spectrum and the substance may be nonlinear, and PLS as a linear method may not be ideal for modeling; second, if there are multiple substances that need to be modeled, a PLS model needs to be established for each substance, involving multiple preprocessing methods and multiple model parameters, which increases the complexity of the model; third, the PLS method requires a certain number of samples before modeling can be carried out, and predictions cannot be made when the number of modeling samples is small.

[0005] The patent application with publication number CN101419207A discloses a method for predicting the main indicators of flue-cured tobacco smoke. First, a model of the main indicators of flue-cured tobacco smoke is established: the main chemical components and main indicators of smoke of training flue-cured tobacco samples and test flue-cured tobacco samples are detected; the training flue-cured tobacco samples are clustered using gray function clustering; the variables entering the model are determined; a gray prediction model is established between the main indicators of smoke and the main chemical components of each type of sample; a BP neural network is established for each type of training sample; and the main indicators of smoke of the test sample flue-cured tobacco are used to test and adjust the main chemical components. During the detection, the main chemical components of the flue-cured tobacco sample to be tested are clustered and predicted using the model of the class to which it belongs to obtain the main indicators of smoke. This method requires a certain amount of samples to build a model, which is not conducive to the update of the model.

[0006] The patent application with publication number CN104697955A discloses a method and system for predicting cigarette smoke indexes, which obtains the conventional chemical component content of the tobacco to be tested; inputs the conventional chemical component content of the tobacco to be tested into a pre-generated smoke prediction model, which is a model constructed based on smoke indexes and conventional chemical component content; runs the smoke prediction model and outputs the smoke index of the tobacco to be tested. This method also requires a certain amount of samples to build a model, which is not conducive to model updating. Summary of the invention

[0007] In view of the above, the object of the present invention is to provide a multi-chemical index prediction method based on similar spectrum fitting to achieve rapid and accurate prediction of multiple chemical indicators.

[0008] The technical solution provided by the embodiment is:

[0009] A method for predicting multiple chemical indicators based on similar spectrum fitting, characterized by comprising the following steps:

[0010] (1) using a near infrared spectrometer to collect near infrared spectra of multiple samples as a sample set, and using an analytical chemistry method to detect the detection value of each chemical index of each sample;

[0011] (2) After preprocessing each near-infrared spectrum in the sample set, a near-infrared spectrum is selected as the target spectrum, and the similarity between the target spectrum and other near-infrared spectra in the sample set is calculated;

[0012] (3) Under each value of N, for each target spectrum, select N near-infrared spectra with the largest similarity to the target spectrum to perform fitting close to the target spectrum, so as to determine N fitting coefficients corresponding to the near-infrared spectrum, wherein the value of N is a natural number greater than 1;

[0013] (4) using N fitting coefficients to calculate the fitting value of each chemical index of each target spectrum, and calculating the absolute error between the fitting value and the detection value;

[0014] (5) For each chemical index, calculate the average value of the absolute errors corresponding to all near-infrared spectra as the target spectrum, and select the N corresponding to the minimum average value of the absolute error as the final determined value N0;

[0015] (6) The near-infrared spectrum of the sample to be tested is taken as the target spectrum. After preprocessing the target spectrum, the similarity between the target spectrum and other near-infrared spectra in the sample set is calculated, and then N0 near-infrared spectra with the greatest similarity to the target spectrum are selected for fitting close to the target spectrum to determine N0 fitting coefficients corresponding to the near-infrared spectrum, and the fitting value of each chemical index of the target spectrum is calculated using the N0 fitting coefficients.

[0016] Preferably, the preprocessing of each near-infrared spectrum in the sample set includes:

[0017] The near-infrared spectrum is subjected to first-order derivative processing, and then the near-infrared spectrum after the first-order derivative processing is averagely segmented to obtain multiple spectrum segments, and the wave number points in each spectrum segment are corrected.

[0018] Preferably, the correction of the wave number points in each spectrum segment comprises:

[0019] For each spectral segment, calculate the mean(x) and standard deviation std(x) of all wave number points in each spectral segment, and then use the mean(x) and standard deviation std(x) to perform correction according to the following formula:

[0020]

[0021] Among them, x i represents the original value of the i-th wave number point in the spectrum segment, Represents the correction value of the i-th wavenumber point in the spectrum.

[0022] Preferably, the following formula is used to calculate the similarity between the target spectrum and other near-infrared spectra in the sample set:

[0023] s=-log 10 ((1-p)*d)

[0024] Wherein, s represents similarity, p represents the Pearson correlation coefficient, the calculation formula is p=corr(y0,yj), y0 represents the target spectrum, yj represents the jth near-infrared spectrum, and d represents the Euclidean distance between the target spectrum y0 and the near-infrared spectrum yj.

[0025] Preferably, in step (3), for each value of N, for each target spectrum, the fitting problem constructed is:

[0026]

[0027] Among them, y0 represents the target spectrum, Y represents the vector formed by the top N near-infrared spectra with the greatest similarity to the target spectrum, and W represents the vector formed by the N fitting coefficients corresponding to the near-infrared spectrum;

[0028] When solving the fitting problem, constraints are added that the fitting coefficient is non-negative and the sum of the fitting coefficients is 1. By solving the fitting problem, N fitting coefficients corresponding to the near-infrared spectrum are determined.

[0029] Preferably, in step (4), the following formula is used to calculate the fitting value of each chemical index of each target spectrum using N fitting coefficients:

[0030]

[0031] Among them, w j represents the fitting coefficient corresponding to the jth near-infrared spectrum, z j,k represents the chemical value of the kth chemical index in the jth near-infrared spectrum, L k represents the fitted value of the kth chemical index.

[0032] Preferably, after obtaining the average value of the absolute error of each chemical indicator, the average value of the absolute error of each chemical indicator is dimensionally unified, and then the sum of the average values ​​of the absolute errors of all chemical indicators is calculated, and the N corresponding to the minimum sum is selected as the final value N0.

[0033] Preferably, the average value of the absolute error of each chemical indicator is calculated and dimensionally unified in the following manner:

[0034]

[0035] Among them, e k represents the average absolute error of the kth chemical index, f k represents the average value of the detection value of the kth chemical indicator, cv k Represents the dimensionless unified value of the kth chemical index.

[0036] Preferably, the value range of N is 2-100. If the sample size is less than 200, the lower limit of N is 2 and the upper limit is set to half of the total sample size.

[0037] Preferably, when the sample is solid, when collecting the near infrared spectrum of the sample using a near infrared spectrometer, the solid is required to be in powder form with a particle size of 35-45 mesh, more preferably 40 mesh.

[0038] The beneficial effects include at least:

[0039] The multi-chemical index prediction method based on similar spectrum fitting provided in the embodiment adopts a local method, has better flexibility than the linear algorithm, and does not use the PLS method for modeling. Therefore, it is less affected by the sample size, parameter selection, etc., and uses similar near-infrared spectra to fit the target spectrum, avoiding the fitting of multiple dissimilar near-infrared spectra as the target spectrum and overfitting. In addition, this method can realize the one-time prediction of multiple indicators without the need for modeling one by one. For newly added chemical indicators, they can be directly predicted by this method without the need for PLS modeling, thereby improving the prediction efficiency and accuracy of chemical indicators. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] 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 creative work.

[0041] Figure 1 It is a flow chart of a method for predicting multiple chemical indicators based on similar spectrum fitting provided by an embodiment.

[0042] Figure 2 It is a tobacco leaf near infrared spectrum provided by an embodiment;

[0043] Figure 3 This is a diagram of the similarity and ranking of the near infrared spectrum corresponding to sample No. 1 with other near infrared spectra when the near infrared spectrum corresponding to sample No. 1 is used as the target spectrum, wherein the number indicates the sample number, that is, the number of the near infrared spectrum;

[0044] Figure 4 This is a fitting parameter of each near-infrared spectrometer when the near-infrared spectrum corresponding to sample No. 1 is used as the target spectrum, provided by an embodiment, when N=5, wherein 1-5 correspond to samples No. 50, No. 63, No. 3, No. 38, and No. 34 in the training set, respectively;

[0045] Figure 5 is the fitting error of the training set provided by an embodiment, and reaches the minimum value when N=63. DETAILED DESCRIPTION

[0046] To make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific implementation methods described herein are only used to explain the present invention and do not limit the scope of protection of the present invention.

[0047] Figure 1 FIG. 1 is a flow chart of a method for predicting multiple chemical indicators based on similar spectrum fitting provided by an embodiment. Figure 1As shown, the multi-chemical index prediction method based on similar spectrum fitting provided in the embodiment includes the following steps:

[0048] Step 1: Use a near-infrared spectrometer to collect near-infrared spectra of multiple samples as a sample set, and use analytical chemistry methods to detect the detection value of each chemical indicator of each sample.

[0049] In the embodiment, the sample can be a liquid sample or a solid sample. When it is a solid sample, in order to improve the accuracy of collecting near infrared spectra, the particle size of the solid sample powder is limited to 40 mesh.

[0050] In the embodiment, an analytical chemical method is also used to detect the detection value of each chemical index of each sample, and the detection value is used for subsequent evaluation of the gap between the fitting value and the detection value to screen similar samples.

[0051] Step 2: Preprocess each near-infrared spectrum in the sample set.

[0052] In the embodiment, the preprocessing of the near-infrared spectrum includes first-order derivative and numerical correction processing. When performing the first-order derivative processing of the near-infrared spectrum, the parameters are window width 15 and polynomial order 2. When the near-infrared spectrum after the first-order derivative processing is numerically corrected, in order to improve the accuracy of the correction, a segmented correction method is adopted, that is, the near-infrared spectrum is evenly segmented to obtain multiple spectral segments, each spectral segment contains M wavenumber points, and the value range of M is 40-60, and then the wavenumber points in each spectral segment are corrected within the spectral segment. The process is: for each spectral segment, the mean mean(x) and standard deviation std(x) of all wavenumber points in each spectral segment are calculated, and then the mean mean(x) and standard deviation std(x) are used to correct according to the following formula:

[0053]

[0054] Among them, x i represents the original value of the i-th wave number point in the spectrum segment, Represents the correction value of the i-th wavenumber point in the spectrum.

[0055] Step 3: Take each near-infrared spectrum as the target spectrum and calculate the similarity between the target spectrum and other near-infrared spectra in the sample set.

[0056] The similarity calculation is performed on the preprocessed near-infrared spectra. The specific process is: select one near-infrared spectrum as the target spectrum, and then use the following formula to calculate the similarity between the target spectrum and other near-infrared spectra in the sample set:

[0057] s=-log 10 ((1-p)*d)

[0058] Wherein, s represents similarity, p represents the Pearson correlation coefficient, the calculation formula is p=corr(y0,yj), y0 represents the target spectrum, yj represents the jth near-infrared spectrum, and d represents the Euclidean distance between the target spectrum y0 and the near-infrared spectrum yj.

[0059] After obtaining the similarity between each target spectrum and all other near-infrared spectra in the sample set, a similarity ranking is performed for each target spectrum for subsequent similarity screening.

[0060] Step 4: for each target spectrum, for the current N value, select the N near-infrared spectra with the top N similarities to the target spectrum to perform fitting close to the target spectrum, so as to determine N fitting coefficients corresponding to the near-infrared spectrum.

[0061] In the embodiment, the value of N is a natural number greater than 1, and further, the value is a natural number between 2 and 100. Under each N value, for each target spectrum, the N near-infrared spectra with the largest similarity to the target spectrum are selected to fit the target spectrum to determine the N fitting coefficients corresponding to the near-infrared spectrum. In this way, 30 rounds of calculations are required to obtain the fitting coefficients under each N value.

[0062] In the embodiment, at each value of N, for each target spectrum, the fitting problem constructed is:

[0063]

[0064] Among them, y0 represents the target spectrum, Y represents the vector formed by the top N near-infrared spectra with the greatest similarity to the target spectrum, and W represents the vector formed by the N fitting coefficients corresponding to the near-infrared spectrum;

[0065] When solving the fitting problem, constraints are added that the fitting coefficient is non-negative and the sum of the fitting coefficients is 1. By solving the fitting problem, N fitting coefficients corresponding to the near-infrared spectrum are determined.

[0066] Step 5, using N fitting coefficients to calculate the fitting value of each chemical index of each target spectrum, and calculate the absolute error between the fitting value and the detection value.

[0067] In the embodiment, at each value of N, the following formula is used to calculate the fitting value of each chemical index of each target spectrum using N fitting coefficients:

[0068]

[0069] Among them, w j represents the fitting coefficient corresponding to the jth near-infrared spectrum, z j,k represents the chemical value of the kth chemical index in the jth near-infrared spectrum, L k represents the fitted value of the kth chemical index.

[0070] Step 6: For each chemical indicator, calculate the average value of the absolute errors of all near-infrared spectra corresponding to the target spectrum, and select the N0 corresponding to the minimum average value of the absolute error as the final determined value.

[0071] In an embodiment, the N value that is adapted to a single chemical indicator can be screened and used as the final determined value N0 for the prediction of a single chemical indicator of a subsequent test sample. The specific process is: for each chemical indicator, all near-infrared spectra are calculated as the average value of the absolute errors corresponding to the target spectrum. If there are Q samples in total, this process will obtain the average values ​​of Q absolute errors, and then the N corresponding to the minimum average value of the absolute errors is screened from the average values ​​of the Q absolute errors as the final determined value N0.

[0072] In the embodiment, the N value that is suitable for all chemical indicators can also be selected as the final determined value N0 to be used for the prediction of all chemical indicators of the subsequent test samples. The specific process is: after obtaining the average value of the absolute error of each chemical indicator, the average value of the absolute error of each chemical indicator is dimensionally unified, and the calculation formula is:

[0073]

[0074] Among them, e k represents the average absolute error of the kth chemical index, f k represents the average value of the detection value of the kth chemical indicator, cv k Represents the dimensionless unified value of the kth chemical index.

[0075] Then, the sum of the average values ​​of the absolute errors of all chemical indicators is calculated, and the N corresponding to the minimum sum is selected as the final value N0.

[0076] Step 7, taking the near infrared spectrum of the test sample as the target spectrum, using the finally determined N0, and following steps 2 to 5, calculating the fitting value of each chemical index of the target spectrum.

[0077] In the embodiment, the near-infrared spectrum of the sample to be tested is taken as the target spectrum. After preprocessing the target spectrum, the similarity between the target spectrum and other near-infrared spectra in the sample set is calculated, and then N0 near-infrared spectra with the greatest similarity to the target spectrum are selected for fitting close to the target spectrum to determine N0 fitting coefficients corresponding to the near-infrared spectrum, and the fitting values ​​of each chemical index of the target spectrum are calculated using the N0 fitting coefficients.

[0078] Experimental example

[0079] In the experimental example, 646 flue-cured tobacco samples from a certain enterprise were selected. After sampling, the samples were prepared into powder samples according to the tobacco industry standard "YC / T31-1996 Preparation of Tobacco and Tobacco Products Samples and Moisture Determination Oven Method" (the tobacco leaves were placed in an oven, dried at 40°C for 4 hours, and ground with a cyclone mill (FOSS) to pass through a 40-mesh sieve), and spectral measurements were performed after sealing and balancing for 1 day. At the same time, the detection values ​​of the target chemical indicators of the samples were measured using the national standard method or other methods, including total sugar, nicotine, reducing sugar, chlorine, potassium, and total nitrogen. At the same time, the near-infrared spectrum of the sample was collected, such as Figure 2 Then, according to the steps 2 to 7 of the multi-chemical index prediction method based on similar spectrum fitting, the test is carried out, and No. 1 is taken as the target. The near infrared spectrum similarity ranking of other samples is as follows: Figure 3 As shown, Figure 4 The five most similar samples and fitting coefficients of sample No. 1 are given when N=5. Figure 5 The training set fitting error is given, and it reaches the minimum value when N=63.

[0080] 230 tobacco leaf samples were independent of the training set. The near infrared spectra were collected and the detection values ​​of chemical indicators were determined in the same way as the training samples. In order to reflect the advantages of this method, the training set was modeled using the partial least squares method (PLS2) and the test results of the test set were compared.

[0081] Table 1. Training and testing results of the method of the present invention

[0082]

[0083]

[0084] Table 2. PLS method training and testing results

[0085]

[0086] Table 3 Wilcoxon signed rank test to compare the differences between the two methods

[0087]

[0088] From the analysis of Tables 1 to 3, it can be seen that in the prediction results of the PLS model, the prediction errors of the three indicators of total sugar, nicotine, and reducing sugar are much larger than the training error, showing an overfitting tendency, while the prediction errors of the three indicators of chlorine, potassium, and total nitrogen are lower than the training error, which is contrary to common sense and should be caused by coincidence in data batches. In contrast, the prediction errors of the six indicators of this method are slightly higher than the training error, and the prediction results are comparable to those of the PLS method, showing good modeling and model prediction effects.

[0089] The specific implementation methods described above provide a detailed description of the technical solutions and beneficial effects of the present invention. It should be understood that the above is only the most preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, supplements and equivalent substitutions made within the scope of the principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A multi-chemical index prediction method based on similarity spectrum fitting, characterized in that: The following steps are involved: (1) using a near infrared spectrometer to collect near infrared spectra of multiple samples as a sample set, and using an analytical chemistry method to detect the detection value of each chemical index of each sample; (2) After preprocessing each near-infrared spectrum in the sample set, each near-infrared spectrum is used as a target spectrum, and the similarity between the target spectrum and other near-infrared spectra in the sample set is calculated; (3) Under each value of N, for each target spectrum, select N near-infrared spectra with the largest similarity to the target spectrum to perform fitting close to the target spectrum, so as to determine N fitting coefficients corresponding to the near-infrared spectrum, wherein the value of N is a natural number greater than 1; (4) using N fitting coefficients to calculate the fitting value of each chemical index of each target spectrum, and calculating the absolute error between the fitting value and the detection value; (5) For each chemical index, calculate the average value of the absolute errors corresponding to all near-infrared spectra as the target spectrum, and select the N corresponding to the minimum average value of the absolute error as the final determined value N0; (6) The near-infrared spectrum of the sample to be tested is taken as the target spectrum. After preprocessing the target spectrum, the similarity between the target spectrum and other near-infrared spectra in the sample set is calculated, and then N0 near-infrared spectra with the greatest similarity to the target spectrum are selected for fitting close to the target spectrum to determine N0 fitting coefficients corresponding to the near-infrared spectrum, and the fitting value of each chemical index of the target spectrum is calculated using the N0 fitting coefficients.

2. The method for predicting multiple chemical indicators based on similar spectrum fitting according to claim 1, characterized in that: The preprocessing of each near infrared spectrum in the sample set includes: The near-infrared spectrum is subjected to first-order derivative processing, and then the near-infrared spectrum after the first-order derivative processing is averagely segmented to obtain multiple spectrum segments, and the wave number points in each spectrum segment are corrected.

3. The method for predicting multiple chemical indicators based on similar spectrum fitting according to claim 2, characterized in that: The correcting of the wave number points in each spectrum segment comprises: For each spectral segment, calculate the mean(x) and standard deviation std(x) of all wave number points in each spectral segment, and then use the mean(x) and standard deviation std(x) to perform correction according to the following formula: Among them, x i represents the original value of the i-th wave number point in the spectrum segment, Represents the correction value of the i-th wavenumber point in the spectrum.

4. The method for predicting multiple chemical indicators based on similar spectrum fitting according to claim 1, characterized in that: The similarity between the target spectrum and other near-infrared spectra in the sample set is calculated using the following formula: s=-log 10 ((1-p)*d) Wherein, s represents similarity, p represents the Pearson correlation coefficient, the calculation formula is p=corr(y0,yj), y0 represents the target spectrum, yj represents the jth near-infrared spectrum, and d represents the Euclidean distance between the target spectrum y0 and the near-infrared spectrum yj.

5. The method for predicting multiple chemical indicators based on similar spectrum fitting according to claim 1, characterized in that: In step (3), for each value of N, the fitting problem constructed for each target spectrum is: Among them, y0 represents the target spectrum, Y represents the vector formed by the top N near-infrared spectra with the greatest similarity to the target spectrum, and W represents the vector formed by the N fitting coefficients corresponding to the near-infrared spectrum; When solving the fitting problem, constraints are added that the fitting coefficient is non-negative and the sum of the fitting coefficients is 1. By solving the fitting problem, N fitting coefficients corresponding to the near-infrared spectrum are determined.

6. The method for predicting multiple chemical indicators based on similar spectrum fitting according to claim 1, characterized in that: In step (4), the following formula is used to calculate the fitting value of each chemical index of each target spectrum using N fitting coefficients: Among them, w j represents the fitting coefficient corresponding to the jth near-infrared spectrum, z j,k represents the chemical value of the kth chemical index in the jth near-infrared spectrum, L k represents the fitted value of the kth chemical index.

7. The method for predicting multiple chemical indicators based on similar spectrum fitting according to claim 1, characterized in that: After obtaining the average value of the absolute error of each chemical indicator, the average value of the absolute error of each chemical indicator is dimensionally unified, and then the sum of the average values ​​of the absolute errors of all chemical indicators is calculated, and the N corresponding to the minimum sum is selected as the final value N0.

8. The method for predicting multiple chemical indicators based on similar spectrum fitting according to claim 7, characterized in that: The average value of the absolute error of each chemical indicator is calculated and dimensionally unified in the following way: Among them, e k represents the average absolute error of the kth chemical index, f k represents the average value of the detection value of the kth chemical indicator, cv k Represents the dimensionless unified value of the kth chemical index.

9. The method for predicting multiple chemical indicators based on similar spectrum fitting according to claim 1, characterized in that: The value range of N is 2-100. If the sample size is less than 200, the lower limit of N is 2 and the upper limit is set to half of the total sample size.

10. The method for predicting multiple chemical indicators based on similar spectrum fitting according to claim 1, characterized in that: When the sample is solid, when using a near-infrared spectrometer to collect the near-infrared spectrum of the sample, the solid is required to be in powder form with a particle size of 35-45 mesh.