Small sample near infrared spectrum calibration method based on partial least square score
Through the small sample near-infrared spectral calibration method of partial least squares score and integrated orthogonal limit learning machine, the problems of insufficient sample size and improper selection of principal components in near-infrared spectral analysis are solved, and high-performance and robust small sample modeling is achieved, which is suitable for a variety of detection objects such as corn, tobacco leaves, tablets, wheat and mangoes.
Patent Information
- Application Number
- CN202510675420.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-23
- Publication Date
- 2025-08-08
AI Technical Summary
The prior art requires a large amount of sample data in near-infrared spectral analysis, and improper selection of principal components leads to deviations in prediction results, making it difficult to achieve high-performance and robust small sample modeling.
A small sample near-infrared spectral calibration method with partial least squares score is adopted. By constructing a partial least squares model and an integrated orthogonal limit learning machine, the optimal number of latent variables is obtained using the partial least squares algorithm, a concentration relationship model is built in combination with the orthogonal limit learning organization, and the model generalization ability is improved through an integrated learning strategy.
A near-infrared spectral quantitative model with high performance and strong robustness under small sample conditions is realized, which reduces the dependence on sample size, improves prediction accuracy and model stability, and is suitable for a variety of detection objects.
Smart Images

Figure CN120446044A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of near-infrared spectrum calibration, and more particularly to a small sample near-infrared spectrum calibration method based on partial least squares score. Background Art
[0002] In recent years, near-infrared spectroscopy has been widely used in various fields as a rapid analytical technique due to its advantages in online monitoring and non-destructive testing. Near-infrared spectroscopy utilizes the absorption and scattering properties of molecules to obtain chemical information. Near-infrared spectroscopy can provide a wealth of chemical information, which is crucial for studying the structure, composition, and changes of substances. It is widely used in agriculture, the food industry, pharmaceutical analysis and quality control, the chemical industry, and environmental monitoring, among other fields.
[0003] To obtain quantitative or qualitative information about a sample from its corresponding spectra, multivariate calibration methods, such as partial least squares (PLS), are often used to establish a relationship between near-infrared spectra and concentration. PLS is a well-established analytical method widely used for quantitative analysis of near-infrared data. It reduces the dimensionality of the data and extracts important underlying information by projecting the raw data onto a set of latent variables. Due to the dimensionality reduction advantages of principal component analysis (PCA), PLS exhibits significant advantages when processing high-dimensional data. However, in PLS, an appropriate number of principal components must be selected based on the sample conditions. Selecting different numbers of principal components can lead to deviations in the prediction results.
[0004] Therefore, a small sample near-infrared spectroscopy calibration method based on partial least squares score is urgently needed. Summary of the Invention
[0005] The purpose of the present invention is to provide a small sample near-infrared spectroscopy calibration method based on partial least squares score to solve the problems in the above-mentioned prior art and to provide a high-performance, robust near-infrared spectroscopy quantitative model suitable for small sample modeling.
[0006] The present invention provides a small sample near-infrared spectrum calibration method based on partial least squares score, which includes:
[0007] Acquire a near-infrared spectral dataset, where the near-infrared spectral dataset is divided into a calibration set and a test set;
[0008] Constructing a partial least squares model: using a partial least squares algorithm to obtain an optimal number of latent variables in the near infrared spectroscopy dataset;
[0009] Construct an integrated orthogonal extreme learning machine;
[0010] Using the calibration set in the near-infrared spectral data set, and according to the partial least squares model and the orthogonal extreme learning machine, constructing a relationship model between the score matrix of the partial least squares model and the concentration content;
[0011] The relationship model is used to predict the concentration in the test set in the near-infrared spectroscopy dataset to obtain concentration information.
[0012] In the small sample near-infrared spectrum calibration method based on partial least squares score as described above, preferably, the acquiring of the near-infrared spectrum dataset includes:
[0013] Acquire multiple near-infrared spectral data of multiple samples of multiple different detection objects from different near-infrared spectrometers through the network, and obtain the content of key components corresponding to each detection object based on the near-infrared spectral data;
[0014] The near-infrared spectral datasets corresponding to different detection objects are divided into calibration sets and test sets.
[0015] In the small sample near-infrared spectroscopy calibration method based on partial least squares scoring as described above, preferably, the detection objects include: corn, tobacco leaves, tablets, wheat and mangoes, the key components corresponding to corn are oil, water, protein and starch; the key component corresponding to tobacco leaves is nitrogen; the key component corresponding to tablets is active substances; the key component corresponding to wheat is protein; and the key component corresponding to mangoes is dry matter.
[0016] In the small sample near-infrared spectroscopy calibration method based on partial least squares scores as described above, preferably, the construction of the partial least squares model: obtaining the optimal number of latent variables in the near-infrared spectroscopy dataset using the partial least squares algorithm includes:
[0017] Based on the spectra and corresponding content information in the near-infrared spectral dataset, a partial least squares model is used to extract two new latent variables by simultaneously reducing the dimensionality of the predictor variable and the response variable, wherein the predictor variable and the response variable are linear combinations of the independent variable and the dependent variable. In the process of constructing the partial least squares model, the partial least squares model maximizes the covariance between the independent variable and the dependent variable, and the optimal latent variable is determined through 10-fold cross validation.
[0018] In the small sample near-infrared spectroscopy calibration method based on partial least squares score as described above, preferably, the constructing of an integrated orthogonal extreme learning machine includes:
[0019] Given the activation function g(x), using the orthogonalization strategy, the output is calculated by the following formula :
[0020]
[0021] in, represents orthogonal random weights, represents the orthogonal random deviation between the input node and the hidden node, and satisfies the following relationship:
[0022] ;
[0023] According to the activation function, a plurality of extreme learning machine models with different numbers of hidden layer nodes are established respectively;
[0024] The average value of the output results of multiple extreme learning machine models is used as the final prediction result.
[0025] In the small sample near-infrared spectrum calibration method based on partial least squares score as described above, preferably, the extreme learning machine model includes three hidden layers, and the number of neurons in each hidden layer is 200, 300 and 400 respectively.
[0026] As described above, the small sample near-infrared spectrum calibration method based on partial least squares score, wherein preferably, the activation function adopts tanh, the coefficient of ridge regression is 50000, and the initialization range of weight and bias is [-0.1, 0.1].
[0027] The small sample near-infrared spectroscopy calibration method based on partial least squares scores as described above, wherein preferably, the calibration set in the near-infrared spectroscopy dataset is used to construct a relationship model between the score matrix of the partial least squares model and the concentration content according to the partial least squares model and the orthogonal extreme learning machine, including:
[0028] The partial least squares model is established using the calibration set X and the response value Y, where for each spectral matrix X, X (i,j) Corresponding to the spectral intensity of the i-th sample at the j-th wavelength, the spectrum of the calibration set is X c ;
[0029] Using the loading matrix in the partial least squares model, the spectrum X of the calibration set is calculated by the following formula c PLS score:
[0030]
[0031] in, represents the spectrum of the calibration set X The PLS score of the model is , W represents the weight matrix of the calibration set X, and P represents the loading matrix of the partial least squares model;
[0032] The calibration relationship between PLS score and concentration was established by orthogonal extreme learning machine.
[0033] In the small sample near-infrared spectroscopy calibration method based on partial least squares score as described above, preferably, the step of using the relational model to predict the concentration in the test set in the near-infrared spectroscopy dataset to obtain concentration information includes:
[0034] The spectra in the test set are calculated by the following formula PLS score: on the test dataset X t Prediction of X t The score can be calculated as:
[0035]
[0036] in, represents the spectrum of the test set X PLS score;
[0037] The spectrum of the test set X The PLS score is input into the orthogonal extreme learning machine to obtain the corresponding response value y i ;
[0038] Calculate the response value y i The average value of is taken as the predicted concentration y.
[0039] As described above, the small sample near-infrared spectrum calibration method based on partial least squares scores, wherein preferably, the small sample near-infrared spectrum calibration method based on partial least squares scores further includes: result evaluation, specifically including:
[0040] The prediction performance of the relationship model is evaluated using the prediction root mean square error and the test set determination coefficient, where:
[0041] The root mean square error of the prediction is calculated by the following formula :
[0042]
[0043] The test set determination coefficient is calculated by the following formula :
[0044]
[0045] Among them, y i represents the true value, Represents the predicted value. represents the mean true value, and n represents the number of spectra.
[0046] The present invention provides a small-sample near-infrared spectrum calibration method based on partial least squares scores. The method mines potential concentration information through the partial least squares score matrix and constructs a PLSELM (partial least squares extreme learning machine) quantitative model, which significantly improves the quantitative analysis performance of near-infrared spectra. The method can provide a high-performance, robust near-infrared spectrum quantitative model suitable for small-sample modeling. In the model building stage, the principal component score matrix of the partial least squares is used as the input of the model to replace the original full-band spectrum. The method can directly learn concentration information from the partial least squares principal component scores through a latent variable hidden layer node parameter update strategy based on orthogonal transformation. The model weights from the input layer to the shallow layer are determined through regularization and orthogonal transformation. In the prediction stage, the output mean of the integrated support vector machine is used as the prediction result to avoid the influence of model randomness. The method has good robustness, does not require a large number of parameter optimization processes, and performs excellently in model transfer applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention will be further described below with reference to the accompanying drawings, in which:
[0048] Figure 1 A flowchart of an embodiment of a small sample near-infrared spectroscopy calibration method based on partial least squares scores provided by the present invention;
[0049] Figure 2 A process implementation logic diagram of an embodiment of a small sample near-infrared spectrum calibration method based on partial least squares scores provided by the present invention;
[0050] Figure 3 Schematic diagram of the RMSEP distribution of the PLSELM method with randomly selected hidden nodes in the range of 200-500 on the corn test set;
[0051] Figure 4 Schematic diagram of RMSEP for different regularization coefficients C on the tobacco dataset (TN2003). DETAILED DESCRIPTION
[0052] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. The description of the exemplary embodiments is merely illustrative and is in no way intended to limit the present disclosure, its application, or use. The present disclosure can be implemented in many different forms and is not limited to the embodiments described herein. These embodiments are provided to make the present disclosure thorough and complete and to fully convey the scope of the present disclosure to those skilled in the art. It should be noted that unless otherwise specifically stated, the relative arrangement of parts and steps, the composition of materials, numerical expressions, and numerical values set forth in these embodiments should be interpreted as being merely exemplary and not as limiting.
[0053] The terms "first," "second," and similar terms used in this disclosure do not indicate any order, quantity, or importance, but are simply used to distinguish different parts. Terms such as "include" or "comprising" mean that the elements preceding the term include the elements listed after the term, and do not exclude the possibility of also including other elements. Terms such as "upper," "lower," and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0054] In the present disclosure, when a specific component is described as being located between a first component and a second component, there may or may not be an intervening component between the specific component and the first component or the second component. When a specific component is described as being connected to another component, the specific component may be directly connected to the other component without an intervening component, or may not be directly connected to the other component but have an intervening component.
[0055] All terms (including technical or scientific terms) used in this disclosure have the same meaning as those understood by one of ordinary skill in the art to which this disclosure belongs, unless otherwise specifically defined. It should also be understood that terms defined in, for example, general dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant technology, and should not be interpreted in an idealized or highly formal sense, unless explicitly defined herein.
[0056] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered part of the specification.
[0057] To obtain quantitative or qualitative information about a sample from its corresponding spectra, multivariate calibration methods, such as partial least squares (PLS), are often used to establish a relationship between near-infrared spectra and concentration. PLS is a well-established analytical method widely used for quantitative analysis of near-infrared data. It reduces the dimensionality of the data and extracts important underlying information by projecting the raw data onto a set of latent variables. Due to the dimensionality reduction advantages of principal component analysis (PCA), PLS exhibits significant advantages when processing high-dimensional data. However, in PLS, an appropriate number of principal components must be selected based on the sample conditions. Selecting different numbers of principal components can lead to deviations in the prediction results.
[0058] In order to solve this problem, calibration methods based on deep learning technology have been widely studied. However, in practical applications, the construction of high-throughput data sets supporting deep learning technology is itself full of challenges. Most quantitative models based on deep learning methods have obvious defects. On the one hand, deep learning methods require a large amount of data, and the repeatability and accuracy of the model increase with the increase of sample size. When the amount of data is small, the advantages of deep learning technology cannot be fully utilized. On the other hand, most methods are generally constructed using convolutional neural networks. The optimization of many hyperparameters such as the number of convolutional layers, the number of convolution kernels, and the convolution size presents different results on different data sets, which means that the optimization of the model needs to be constantly adjusted to adapt to different data sets. In view of this, the present invention provides a small sample near-infrared spectroscopy calibration method based on partial least squares scoring.
[0059] like Figure 1 As shown, the small sample near-infrared spectrum calibration method based on partial least squares score provided in this embodiment includes the following steps in actual implementation:
[0060] Step S1: Acquire a near-infrared spectral dataset, wherein the near-infrared spectral dataset is divided into a calibration set and a test set.
[0061] In one embodiment of the small sample near-infrared spectrum calibration method based on partial least squares score of the present invention, step S1 may specifically include:
[0062] Step S11: obtaining a plurality of near-infrared spectral data of a plurality of samples of a plurality of different detection objects from different near-infrared spectrometers through a network, and obtaining the content of a key component corresponding to each detection object based on the near-infrared spectral data.
[0063] Among them, the detection objects include: corn, tobacco leaves, tablets, wheat and mangoes. The key components corresponding to corn are oil, water, protein and starch; the key component corresponding to tobacco leaves is nitrogen; the key component corresponding to tablets is active substances; the key component corresponding to wheat is protein; and the key component corresponding to mangoes is dry matter.
[0064] In one embodiment of the present invention, the number of samples corresponding to the detection object corn is 80, and the number of detection instruments is 3; the number of samples corresponding to the detection object tobacco leaves is 256, and the number of detection instruments is 2; the number of samples corresponding to the detection object tablets is 615, and the number of detection instruments is 2; the number of samples corresponding to the detection object wheat is 249, and the number of detection instruments is 2; the number of samples corresponding to the detection object mango is 11691, and the number of detection instruments is 2. Specifically, corn data was obtained through the Internet. The dataset included 80 corn samples, and near-infrared spectra were collected on three instruments, and the oil, moisture, protein, and starch contents were obtained. Tobacco data was obtained through the Internet. The dataset included 256 tobacco leaf samples, and near-infrared spectra were collected on two instruments, and the nitrogen content was obtained. Tablet data was obtained through the Internet. The dataset included 615 tablet samples, and near-infrared spectra were collected on two instruments, and the active substance content was obtained. Wheat data was obtained through the Internet. The dataset (calibration set and test set) included 249 spectra, and near-infrared spectra were collected on two instruments, and the protein content was obtained. Mango data was obtained through the Internet. The dataset included 11,691 spectra, and near-infrared spectra were collected on two instruments, and the dry matter content of mango was obtained.
[0065] Step S12: Divide the near-infrared spectral data sets corresponding to different detection objects into a calibration set and a test set.
[0066] In one embodiment of the present invention, as shown in Table 1, five sets of NIR spectral data (comprising 21 concentration metrics from 10 NIR spectrometers) were used to evaluate the performance of the proposed method. These NIR spectra have different wavelength ranges, resolutions, and lengths, and cover a wide range of concentrations. The corn, tobacco, tablet, wheat, and mango datasets were split into calibration and test sets at 80% and 20% respectively. Except for the mango dataset, the samples were segmented using the Kennard-Stone method. Due to the large sample size, the mango dataset was randomly segmented using the aforementioned ratio. All data used were raw spectra without any data preprocessing.
[0067] In calibration analysis, it is crucial to use smaller sample sizes (compared to deep learning) for modeling. To examine the performance of the PCELM method for small-sample learning, a corn dataset (MP6 instrument) was sampled and calibration sets of varying sizes were constructed. Calibration samples were selected from the original calibration set using the Kennard-Stone splitting method.
[0068] Table 1 RMSEP and Q of PLSELM and PLS on the test dataset 2 , LV represents the optimized latent variable
[0069]
[0070] Step S2, constructing a partial least squares (PLS) model: using a partial least squares algorithm to obtain the optimal number of latent variables in the near-infrared spectroscopy dataset.
[0071] Specifically, based on the spectra and corresponding content information in the near-infrared spectral dataset, a partial least squares model is adopted to extract two new latent variables by simultaneously reducing the dimensionality of the predictor variable and the response variable, wherein the predictor variable and the response variable are linear combinations of the independent variable and the dependent variable, and in the process of constructing the partial least squares model, the partial least squares model maximizes the covariance between the independent variable and the dependent variable, and determines the optimal latent variable through 10-fold cross validation.
[0072] For the corn, tobacco, and pill datasets, the maximum latent variables used in the 10-fold cross-validation were 15. For the wheat and mango datasets, the maximum latent variables used in the 10-fold cross-validation were 20 and 40, respectively. The optimal latent variables are abbreviated as LV. All calibration results are summarized and shown in Table 1. As can be seen from Table 1, the PLSELM method has lower RMSEP and higher Q2 than PLS in 16 of the 21 test data sets. In fact, on some datasets where PLS performs well, PLSELM is only slightly worse than PLS. For example, on the tobacco dataset (TN2004), PLS has an RMSEP of 0.0615 and a Q2 of 0.9372, while PLSELM has an RMSEP of 0.0616 and a Q2 of 0.9371. The RMSEP and Q2 of PLSELM are only 0.0001 lower than those of PLS, a very small difference. Overall, PLSELM has a lower RMSEP and a higher Q2, indicating that the PLSELM method has better calibration performance.
[0073] Step S3: construct an integrated orthogonal extreme learning machine.
[0074] In one embodiment of the small sample near-infrared spectrum calibration method based on partial least squares score of the present invention, step S3 may specifically include:
[0075] Step S31: Given the activation function g(x), use the orthogonalization strategy to calculate the output using the following formula: :
[0076]
[0077] in, represents orthogonal random weights, represents the orthogonal random deviation between the input node and the hidden node, and satisfies the following relationship:
[0078] .
[0079] Orthogonalization ensures that adjusting one parameter does not affect the other parameters, making the adjustment process of each parameter independent of each other. Furthermore, during calibration, orthogonalization can remove noise outside of features, making them more uniform and independent, which helps improve the generalization ability of the model.
[0080] Step S32: establishing a plurality of extreme learning machine (ELM) models with different numbers of hidden layer nodes according to the activation function.
[0081] Among them, Figure 2 As shown, the extreme learning machine model includes three hidden layers, and the number of neurons in each hidden layer is 200, 300, and 400, respectively. Furthermore, the activation function uses tanh, the coefficient of ridge regression is 50,000, and the weights and biases are initialized in the range of [-0.1, 0.1].
[0082] In PLSELM, a regularization term is added to improve the generalization performance and make the model more robust. The regularization term is controlled by applying the parameter C in the formula. Figure 4 As shown in Figure 2, different regularization terms C were added to the PCELM model to analyze their impact on the performance of the present invention. Overall, as the regularization coefficient increases, the calibration performance of the PLSELM method gradually improves, namely, the RMSEP (on the tobacco dataset) gradually decreases. When the regularization coefficient C is sufficiently large, the calibration performance of the PLSELM gradually stabilizes. Therefore, the present invention uses a regularization coefficient C of 50,000.
[0083] Step S33: taking the average value of the output results of the multiple extreme learning machine models as the final prediction result.
[0084] Considering that the performance of ELM is related to the number of hidden layer nodes, the present invention adopts an ensemble learning strategy. Specifically, multiple ELM models with different numbers of hidden layer nodes are established, and the average of the output results of the multiple models is taken as the final prediction result.
[0085] Step S4: using the calibration set in the near-infrared spectral data set, according to the partial least squares model and the orthogonal extreme learning machine, constructing a relationship model between the score matrix of the partial least squares model and the concentration content.
[0086] In the present invention, the combination of the partial least squares model and the orthogonal extreme learning machine is called a partial least squares extreme learning machine (PLSELM). In one embodiment of the small sample near-infrared spectrum calibration method based on partial least squares scores of the present invention, step S4 may specifically include:
[0087] Step S41: Use the calibration set X and the response value Y to establish a partial least squares model, where for each spectral matrix X, X (i,j) Corresponding to the spectral intensity of the i-th sample at the j-th wavelength, the spectrum of the calibration set is X c .
[0088] Step S42: Calculate the spectrum X of the calibration set using the loading matrix in the partial least squares model using the following formula: c PLS score:
[0089]
[0090] in, represents the spectrum of the calibration set X W represents the weight matrix of the calibration set X, and P represents the loading matrix of the partial least squares model.
[0091] Step S43: Establish a calibration relationship between the PLS score and the concentration through an orthogonal extreme learning machine.
[0092] Step S5: using the relational model to predict the concentration in the test set in the near-infrared spectral dataset to obtain concentration information.
[0093] In one embodiment of the small sample near-infrared spectrum calibration method based on partial least squares score of the present invention, step S5 may specifically include:
[0094] Step S51: Calculate the spectrum in the test set using the following formula: PLS score: on the test dataset X t Prediction of X t The score can be calculated as:
[0095]
[0096] in, represents the spectrum of the test set X PLS score.
[0097] Step S52: The spectrum of the test set X The PLS score is input into the orthogonal extreme learning machine to obtain the corresponding response value y i .
[0098] Step S53: Calculate the response value yi The average value of is taken as the predicted concentration y.
[0099] For the mango dataset, a single modeling and prediction process (one PLS + one PLSELM model) took approximately 3.4 seconds (cross-validation of 40 latent variables). For the corn dataset, a single modeling and prediction took approximately 0.5 seconds. For the tobacco dataset, a single modeling and prediction took approximately 2.8 seconds. For the pharmaceutical tablet dataset, a single modeling and prediction took approximately 2.7 seconds. For the wheat dataset, a single modeling and prediction took approximately 1.2 seconds. For the mango dataset, a single modeling and prediction took approximately 3.4 seconds. In summary, PLSELM can complete calibration analysis in a very short time, with high quantitative speed, meeting the needs of analysis under various conditions (such as on-site).
[0100] Furthermore, in some embodiments of the present invention, the small sample near-infrared spectroscopy calibration method based on partial least squares score further includes:
[0101] Step S6: Result evaluation.
[0102] Specifically, the root mean square error of prediction (RMSEP) and the coefficient of determination (Q 2 ) evaluates the predictive performance of the relationship model, where:
[0103] The root mean square error of the prediction is calculated by the following formula :
[0104]
[0105] The test set determination coefficient is calculated by the following formula :
[0106]
[0107] Among them, y i represents the true value, Represents the predicted value. represents the mean true value, and n represents the number of spectra.
[0108] All calibration results of five sets of NIR spectral data (including 21 sets of concentration indicators from 10 NIR spectrometers) are summarized and shown in Table 1. As can be seen from Table 1, among the 21 test set data, the RMSEP of the PLSELM method is lower than that of PLS for 16 sets, and the Q 2 Higher than PLS; in fact, on some data sets where PLS performs well, PLSELM is only slightly worse than PLS. For example, on the tobacco data set (TN2004), the RMSEP of PLS is 0.0615, and Q 2is 0.9372, while the RMSEP of PLSELM is 0.0616, Q 2 The RMSEP and Q of PLSELM are 0.9371. 2 It is only 0.0001 worse than PLS, which is a very small difference. In general, the RMSEP of PLSELM is lower, and Q 2 is higher, indicating that the PLSELM method has better calibration performance.
[0109] Calibration transfer is a critical issue in near-infrared spectroscopy. Through calibration transfer, near-infrared calibration models established based on high-resolution instruments can be applied to near-infrared spectra acquired with low-resolution instruments. Calibration transfer can reduce the labor and material resources required for model reconstruction and improve prediction results for low-quality data. This study compared the performance of PLS and PLSELM in calibration transfer using both the extreme learning machine autoencoder (TEAM) method and direct calibration transfer from canonical correlation analysis to principal components (PCCCA). Specifically, the performance of PLS and PLSELM in calibration transfer was compared under the same transfer conditions, disregarding the differences between calibration transfer methods. As shown in Table 2, all transfer models were established using the Kennard-Stone segmentation method using 30 spectra selected from the calibration dataset. PCELM outperformed PLS in 20 of the 24 results (12 datasets, two model transfer methods). For example, in the starch concentration migration of the corn dataset (MP5-M5), the PLSELM based on the TEAM model achieved an RMSEP of 0.3414, which was 0.0088 lower than the RMSEP of PLS (0.3502). For the same data set, the PLSELM based on the PCCCA method achieved an RMSEEP of 0.3679, which was 0.0134 lower than the RMSEEP of PLS (0.3813). These results demonstrate the strong applicability of the PLSELM method in calibration migration studies.
[0110] Table 2 RMSEP of test datasets for different calibration transfer methods
[0111]
[0112] To demonstrate the role of the PLS score in the calibration model, an ELM calibration method based on raw spectra and response values was implemented (see Table 3). Comparison revealed that, in 11 of the 21 test data sets, the ELM method achieved lower RMSEP and higher Q2 than the PLS method, making the two methods nearly evenly matched. For spectra with higher data quality, such as the corn dataset (M5 instrument), the calibration model directly based on the ELM did not demonstrate good performance. This may be because the ELM model parameters cannot be effectively updated when the raw spectra are directly used to establish the model. This is due to the high level of interference and redundant information in the raw spectra. Comparison results indicate that utilizing the PLS score significantly improves calibration performance. Therefore, directly using the PLS score to establish the calibration model is of great significance.
[0113] Table 3. RMSEP and Q of ELM and PLS on the test dataset 2 , LV represents the optimized latent variable
[0114]
[0115] Because the initialization of hidden layer nodes and weights in the ELM is random, the calibration process needs to be repeated to ensure the stability of the PCELM-ELM method. The number of hidden layer nodes in each PLSELM was randomly selected between 200 and 500. The model reconstruction and prediction process was repeated one thousand times. Figure 3 The figure shows the RMSEP distribution of the PLSELM method with randomly selected hidden nodes in the range of 200-500 on the corn test set. Figure 3 As shown, the mean of the RMSEP distribution on the corn (MP6) test set is 0.1012 and the variance is 1.5114×10 -7 The variances of these results are relatively small, which fully demonstrates the robustness of the PLSELM method.
[0116] The embodiment of the present invention provides a small-sample near-infrared spectrum calibration method based on partial least squares scores. It mines potential concentration information through the partial least squares score matrix and constructs a PLSELM (partial least squares extreme learning machine) quantitative model, which significantly improves the quantitative analysis performance of near-infrared spectra. It can provide a high-performance, robust near-infrared spectrum quantitative model suitable for small-sample modeling. In the model building stage, the principal component score matrix of the partial least squares is used as the input of the model to replace the original full-band spectrum. Through the latent variable hidden layer node parameter update strategy based on orthogonal transformation, concentration information can be directly learned from the partial least squares principal component scores. The model weights from the input layer to the shallow layer are determined by regularization and orthogonal transformation. In the prediction stage, the output mean of the integrated support vector machine is used as the prediction result to avoid the influence of model randomness. It has good robustness, does not require a large number of parameter optimization processes, and performs excellently in model transfer applications.
[0117] Thus far, various embodiments of the present disclosure have been described in detail. To avoid obscuring the concept of the present disclosure, some details known in the art have not been described. Based on the above description, those skilled in the art can fully understand how to implement the technical solutions disclosed herein.
[0118] Although some specific embodiments of the present disclosure have been described in detail through examples, those skilled in the art will understand that the above examples are for illustration only and are not intended to limit the scope of the present disclosure. Those skilled in the art will understand that the above embodiments may be modified or some technical features may be replaced with equivalents without departing from the scope and spirit of the present disclosure. The scope of the present disclosure is defined by the appended claims.
Claims
1. A small sample near infrared spectroscopy calibration method based on partial least squares score, characterized in that: include: Acquire a near-infrared spectral dataset, where the near-infrared spectral dataset is divided into a calibration set and a test set; Constructing a partial least squares model: using a partial least squares algorithm to obtain an optimal number of latent variables in the near infrared spectroscopy dataset; Construct an integrated orthogonal extreme learning machine; Using the calibration set in the near-infrared spectral data set, and according to the partial least squares model and the orthogonal extreme learning machine, constructing a relationship model between the score matrix of the partial least squares model and the concentration content; The relationship model is used to predict the concentration in the test set in the near-infrared spectroscopy dataset to obtain concentration information.
2. The small sample near infrared spectroscopy calibration method based on partial least squares score according to claim 1, characterized in that: The acquiring of a near-infrared spectral data set comprises: Acquire multiple near-infrared spectral data of multiple samples of multiple different detection objects from different near-infrared spectrometers through the network, and obtain the content of key components corresponding to each detection object based on the near-infrared spectral data; The near-infrared spectral datasets corresponding to different detection objects are divided into calibration sets and test sets.
3. The small sample near-infrared spectroscopy calibration method based on partial least squares score according to claim 2, characterized in that: The detection objects include: corn, tobacco leaves, tablets, wheat and mangoes. The key components corresponding to corn are oil, water, protein and starch; the key component corresponding to tobacco leaves is nitrogen; the key component corresponding to tablets is active substances; the key component corresponding to wheat is protein; and the key component corresponding to mangoes is dry matter.
4. The small sample near-infrared spectroscopy calibration method based on partial least squares score according to claim 1, characterized in that The constructing of the partial least squares model: using the partial least squares algorithm to obtain the optimal number of latent variables in the near infrared spectroscopy dataset, including: Based on the spectra and corresponding content information in the near-infrared spectral dataset, a partial least squares model is used to extract two new latent variables by simultaneously reducing the dimensionality of the predictor variable and the response variable, wherein the predictor variable and the response variable are linear combinations of the independent variable and the dependent variable. In the process of constructing the partial least squares model, the partial least squares model maximizes the covariance between the independent variable and the dependent variable, and the optimal latent variable is determined through 10-fold cross validation.
5. The small sample near infrared spectrum calibration method based on partial least squares score according to claim 1, characterized in that: The construction of an integrated orthogonal extreme learning machine includes: Given the activation function g(x), using the orthogonalization strategy, the output is calculated by the following formula : in, represents orthogonal random weights, represents the orthogonal random deviation between the input node and the hidden node, and satisfies the following relationship: ; According to the activation function, a plurality of extreme learning machine models with different numbers of hidden layer nodes are established respectively; The average value of the output results of multiple extreme learning machine models is used as the final prediction result.
6. The small sample near-infrared spectrum calibration method based on partial least squares score according to claim 5, characterized in that: The extreme learning machine model includes three hidden layers, and the number of neurons in each hidden layer is 200, 300 and 400 respectively.
7. The small sample near-infrared spectroscopy calibration method based on partial least squares score according to claim 5, characterized in that: The activation function uses tanh, the coefficient of ridge regression is 50000, and the initialization range of weights and biases is [-0.1, 0.1].
8. The small sample near-infrared spectrum calibration method based on partial least squares score according to claim 1, characterized in that: The method utilizes the calibration set in the near-infrared spectral data set, constructs a relationship model between the score matrix of the partial least squares model and the concentration content according to the partial least squares model and the orthogonal extreme learning machine, including: The partial least squares model is established using the calibration set X and the response value Y, where for each spectral matrix X, X (i,j) Corresponding to the spectral intensity of the i-th sample at the j-th wavelength, the spectrum of the calibration set is X c ; Using the loading matrix in the partial least squares model, the spectrum X of the calibration set is calculated by the following formula c PLS score: in, represents the spectrum of the calibration set X The PLS score of the model is , W represents the weight matrix of the calibration set X, and P represents the loading matrix of the partial least squares model; The calibration relationship between PLS score and concentration was established by orthogonal extreme learning machine.
9. The small sample near-infrared spectrum calibration method based on partial least squares score according to claim 8, characterized in that: The using the relational model to predict the concentration in the test set in the near-infrared spectroscopy dataset to obtain concentration information includes: The spectra in the test set are calculated by the following formula PLS score: on the test dataset X t Prediction of X t The score can be calculated as: in, represents the spectrum of the test set X PLS score; The spectrum of the test set X The PLS score is input into the orthogonal extreme learning machine to obtain the corresponding response value y i ; Calculate the response value y i The average value of is taken as the predicted concentration y.
10. The small sample near infrared spectrum calibration method based on partial least squares score according to claim 1, characterized in that: The small sample near-infrared spectrum calibration method based on partial least squares score further includes: result evaluation, specifically including: The prediction performance of the relationship model is evaluated using the prediction root mean square error and the test set determination coefficient, where: The root mean square error of the prediction is calculated by the following formula : The test set determination coefficient is calculated by the following formula : Among them, y i represents the true value, Represents the predicted value. represents the mean true value, and n represents the number of spectra.