Application of NIR Spectral Standardization Based on Principal Component Score Evaluation in Wheat Flour Crude Protein Model Sharing

In order to explore spectral standardization methods for spectra collected by diﬀerent NIR spectrometers, to reduce spectral diﬀerences, and to realize model sharing among diﬀerent instruments, the crude protein content of 154 wheat ﬂour samples was measured using one grating and three Fabry-Perot tunable ﬁlter NIR spectrometers in wavelength. At the same wavelength range and wavelength interval, three algorithms, namely, direct standardization (DS), piecewise direct standardization (PDS), and simple linear regression direct standardization (SLRDS), were used to standardize spectra collected by diﬀerent instruments from the same samples. Spectral standardization error rate (SSER), principal component score error rate (PCSER), and other indicators were employed to analyze the spectral diﬀerences between the master and the target spectra, and the eﬀect of model sharing was evaluated using parameters including prediction correlation coeﬃcient ( R p ), root mean square error of prediction (RMSEP), and relative prediction deviation (RPD). The results show the following: (1) The diﬀerence between spectra can be quantitatively evaluated through analyzing SSER and PCSER. (2) After standardization by the three algorithms, the spectral diﬀerence between the three target and the master spectrometers is signiﬁcantly reduced and the prediction eﬀect of the master model is greatly improved. (3) Among the three algorithms, DS algorithm had the smallest error rate in standardizing spectra from three target spectrometers. After standardization by the DS algorithm, the master model had the best eﬀect. Its prediction accuracy was greatly improved compared with that before standardization. (4) The standard model established based on the S450 spectrometer can be applied to the same spectrometer as the N500 spectrometer with the same resolution and diﬀerent wavelength ranges, so as to achieve model sharing. Therefore, DS, PDS, and SLRDS algorithms can eﬀectively reduce the spectral diﬀerences between diﬀerent instruments and realize the sharing of NIR calibration models for wheat ﬂour crude protein measurement.


General Process of Model Transfer.
Modern near-infrared spectroscopy analysis is an indirect analysis technology, which combines spectrometry measurement technology and chemometrics theory [1][2][3][4]. It has the advantages of nondestructive, fast, efficient, and multicomponent simultaneous detection and can realize online detection [5][6][7][8][9]. At present, near-infrared spectroscopy analysis technology is widely used in food, medicine, agriculture, petrochemical industry, and other fields. However, in the application process of NIR spectroscopy, due to differences in spectroscopic systems, light sources, detectors and other components, assembly process, and detection environment among different NIR spectrometers, the same samples exhibit different spectral features when analyzed with different spectral instruments. us, when a calibration model setup for one instrument is applied to another instrument, the test results could have a large deviation or even the model may become nonfunctional. Nevertheless, it takes a lot of manpower and material resources to reestablish a model that can be applied in actual production. erefore, the realization of model sharing between different instruments is of great significance for practical application and promotion of NIR spectroscopy analysis technology [10][11][12][13][14][15].
In recent years, many researchers in China and other countries have conducted in-depth studies on model transfer of NIR spectroscopy and achieved great progress [16][17][18][19]. e methods to realize model transfer can be divided into three categories: e first is to correct the parameters of the prediction model, such as the two-step partial least squares method. e second is to correct the prediction results of the model, such as the slope/deviation algorithm. e third is to correct spectral data, such as direct standardization algorithm [20]. To correct the parameters of the prediction model is to enhance the predictive effect of the model by adding a series of sample spectra measured under new environmental conditions and/or with new instruments, so that the model can adapt to the sample spectra collected under new testing conditions. To correct the predicted results of the model assumes that the predicted results of the master spectrometer and the target spectrometer are linearly related, and model transfer is realized through reducing systematic error of the prediction results. However, the above assumption is not valid in most cases.
erefore, it has a poor effect on model transfer and is only applicable under special conditions. To correct spectral data is to standardize spectra, which makes spectra of the same sample collected by different instruments and under different testing conditions as consistent as possible [21,22]. us, the differences between spectra are reduced, so that the established model can be shared between different instruments. e methods of correcting parameters of the prediction model and correcting prediction results of the model are generally called the transfer of the calibration model, and the latter realizes sharing of the calibration model [23].
In this experiment, the crude protein content of wheat flour was taken as the detection index and two NIR spectrometers with different spectroscopic principles, namely, grating scanning type and Fabry-Perot interferometer type, were used to collect NIR spectral data of wheat flour samples. At the same wavelength range and wavelength interval, direct standardization (DS), piecewise direct standardization (PDS), and simple linear regression direct standardization (SLRDS) algorithms were employed to standardize sample spectra. After analyzing the error rate of spectral standardization, the error rate of principal component score was put forward to quantitatively describe the spectra difference between master and target spectrometers of the same sample before and after standardization. e smaller the error rate, the smaller the spectra difference of samples. ese two evaluation indexes can preliminarily evaluate the advantages and disadvantages of spectral standardization methods without completing a whole set of model prediction work, which can save time and provide convenience for model sharing.

Model Sharing Based on Principal Component Score Evaluation.
In the NIR calibration model established by the partial least squares (PLS) method, principal component decomposition of the spectral data matrix and variable matrix is required. After obtaining the loading matrix and the score matrix, the number of selected principal components is determined according to the principle of minimum predictive residual error sum of squares (PRESS) cross-verified by the leave-one-out method, based on which the calibration model is established. erefore, the effect of spectral standardization can be evaluated by the principal component error of the same group of samples after standardization treatment to spectra collected by master and target spectrometers. Specifically, the standardized spectra of target spectrometers are put into the principal component matrix of the calibration model for calculating the score of each principal component. en, the obtained principal component scores are compared with those of the master spectrometer. e smaller the difference, the better the effect of spectral standardization on the target spectrometer (otherwise, vice versa). On this basis, the principal component error rate (described in Section 2.3.2) was proposed to quantitatively evaluate the difference of principal components so as to realize sharing of the wheat flour crude protein model among different instruments. e main algorithm flow is shown in Figure 1. (1) On the basis of proper spectral pretreatment, PLS is used to establish the master model and determine the principal component number, loading matrix, and score matrix. (2) Representative samples are selected from the master and target sample calibration sets as standard sample sets for elaboration of spectral standardization methods (DS, PDS, and SLRDS algorithms). e optimal standard sample number is decided according to the SSER ave minimum principle of master and target sample calibration sets. (3) A variety of spectral standardization methods are used to standardize the target spectral data by using the master spectra of calibration sample sets not involved in spectral standardization as a standard. (4) e standardized spectra of the target spectrometer are put into the principal component matrix of the established calibration model, and the principal component scores are calculated. e differences of principal component scores between the corrected target spectra and the master spectra are evaluated. e similarity of the spectral score matrix of the master and target spectra is quantitatively evaluated by using the principal component score error rate as the evaluation index. If the error is fairly large, the standard sample set should be reselected and the spectral data should be recorrected to enable selection of the optimal standardization method with the minimum error for correcting the spectra of the target prediction set. (5) Finally, the standardized target spectra are put into the master model for prediction and evaluation, so as to realize the sharing of the calibration model established on the master spectrometer with other instruments. ey belong to five categories: low-gluten flour, mediumgluten flour, high-gluten flour, whole wheat flour, and flour with yeast. A total of 154 samples were collected, tightly sealed and refrigerated for later use. e crude protein content of all samples was measured according to the methods and test conditions mandated in GB/T 31578-2015 of China, detailed in "Grain and Oil Testing: Dumas Combustion Method for Determination of Crude Protein in Grains and Grain Products." e crude protein of each sample was tested 3 times in parallel (the relative error was not over 4%), and the average value of the three test results was taken as the measured value of the sample index. e samples were divided into a calibration set (92) and a prediction set (62) in a ratio of 6 : 4 with the SPXY (sample set partitioning based on joint X-Y distance) algorithm. e test results of crude protein content in wheat flour of each set are shown in Table 1.

Instruments and Test
Methods. Absorbance measurements were performed using a benchtop S450 NIR spectrometer (manufactured by Shanghai Lengguang Technology Co., Ltd.) as the master instrument (denoted as M) and three identical protable N500 NIR spectrometers (manufactured by Jinan Hanon Future Technology Co., Ltd.) as the target instruments (denoted as T 1 , T 2 , and T 3 ).  Journal of Food Quality e wavelength range and sampling interval of the NIR spectrometers are shown in Table 2.
For the S450 NIR spectrometer, 16 scans were accumulated and the wavelength interval was 2 nm. A total of 801 data points were collected. For the N500 NIR spectrometers, 3 scans were accumulated and the wavelength interval was also 2 nm. A total of 201 data points were collected.
At a room temperature of 25°C, dark and reference spectra were collected before sample spectra were collected. S450 used Teflon inside the instrument as standard reference spectra, and N500 used a rough-faced gold-plated whiteboard inside the instrument as reference. Sample spectra were repeatedly measured 3 times, and the average of the three collected measurements was taken as the original spectral data of the sample. In order to ensure the consistency of wavelength range in subsequent tests, we selected the spectral data of the 1,550 ∼ 1,950 nm wavelength of the S450 spectrometer for future study of spectral standardization methods. e average spectra of samples collected by the master and target spectrometers are shown in Figure 2. e DS algorithm is based on the mathematical relationship between the spectra of the master standard sample set and the spectra of the target standard sample set to establish the spectral standardized transfer matrix, which is then used to correct the spectra collected from the target spectrometers and reduce spectral differences of the same sample measured between different instruments. e principle of PDS algorithm is similar to DS. Yet, PDS separates continuous wavelengths from spectra, calculates transformation coefficients in each wavelength window, establishes a spectral standardized transfer matrix according to the transformation coefficients of each wavelength window, and uses the transfer matrix to correct the spectra of the target spectrometers to achieve maximum similarity between master and target spectra [12]. e width of the left and right wavelength window region (ω) was set to 3 in the test. e SLRDS algorithm assumes that the absorbance of different wavelength points is independent of each other and uses linear regression to correct spectra from the target spectrometers.

Evaluation Methods of Spectral Differences
(1) Difference of Spectral Data. Spectral standardization error rate (SSER) was used to characterize the standardized accuracy of spectra standardization between different instruments and to quantitatively describe spectral differences between the target spectra after standardization and the master spectra of the same sample. e spectral standardization error rate for a sample is defined as in which {M ij , i � 1,. . .,N, j � 1,. . .,K} is the sample spectral matrix of the master spectrometer; {T ij , i � 1,. . .,N, j � 1,. . .,K}is the sample spectral matrix of target spectrometers after standardization; N is the number of samples; and K is the number of wavelengths in the spectra. For all sample sets, the average error rate SSER ave and maximum error rate SSER max are defined as (2) Error of Principal Component Scores. Principal component score error rate (PCSER) was used to characterize the similarity of principal component score matrices. A lower PCSER means that the principal component score matrix of master and target spectra is more similar and the spectral difference is smaller. e calibration model based on principal component analysis or the partial least square method has a better sharing effect. e PCSER formula of the first n principal component scores between master and target spectra of a sample is as follows: in which T m, i is the score rate of the ith principal component of the master spectrum; T t, i is the score rate of the ith principal component of the target spectrum after standardization of the corresponding spectrum; and W i is the contribution rate of the ith principal component. For all sample sets, the average error rate PCSER ave and maximum error rate PCSER max are defined as

Evaluation of Model Performance.
In the process of model establishment, corrected correlation coefficient (R c ), root mean square error of calibration (RMSEC), and root mean square error of cross validation (RMSECV) were used to evaluate performance of the model and the optimal calibration model was established. After establishment of the model, the prediction performance of the model is evaluated comprehensively using indicators such as prediction correlation coefficient (R p ), root mean square error of prediction (RMSEP), and relative prediction deviation (RPD). e smaller the RMSEC, RMSECV, and RMSEP are and the closer R c and R p are to 1, the better the stability and prediction performance of the established model will be. And, RPD is used to evaluate the accuracy of the model. When RPD <1.75, the prediction accuracy of the model is too low, meaning that the model is not applicable. When RPD ＞3, the prediction accuracy of the model is high [24].

Data Processing and Analysis.
e NIRSA 5.8.8 system (with computer software copyright registration number of 2007SR06801), IBM SPSS Statistics 25, and Excel 2016 were adopted for data analysis. e NIRSA 5.8.8 system was independently developed by the NIR Laboratory of Jiangsu University.

Model Building for the Master Spectrometer.
e PLS method was used to establish a calibration model for the correlation between NIR spectra and crude protein content of 92 calibration set samples collected on the master spectrometer M. In order to fully extract effective information from the spectra, various pretreatment methods were employed to process the original spectra for eliminating irrelevant information and interference information such as noise in the spectral data. e optimal pretreatment method was selected based on predictive effect of the established PLS analysis model. Evaluation results of the calibration model under different pretreatment methods are shown in Table 3.
It can be clearly seen from e regression coefficient of this model is shown in Figure 3.
Ainara López used the AOTF-NIR Analyser (Brimrose) to predict the crude protein content of potatoes in the 1,100 ∼ 2,300 nm. e correlation coefficients of 0.95 and 0.88 were obtained for calibration and validation. e standard errors of calibration and validation were 0.52 and 0.75 [25]. Jing Chen used a diode array analyzer (DA 7200, Perten Instruments, Sweden) to predict the crude protein content of foxtail millet, and the R p and RMSEP were 0.94 and 0.28 [26]. e R p and RMSEP of the obtained optimum models in this research were 0.96 and 0.43 for predicting crude protein content, meaning that the model has high prediction accuracy and realized the rapid nondestruction of crude protein content in wheat flour.

Spectral
Standardization. DS, PDS, and SLRDS algorithms belong to supervised algorithms. Hence, a standard sample set needs to be selected first, and the selection of sample number in the standard sample set has an important impact on the effect of spectral standardization. Too few samples will lead to insufficient information, while too many samples will increase the difficulty of data processing, resulting in illusion of overfitting. Using the Kennard-Stone (K-S) algorithm, 10, 20, 30, 40, 50, and 60 samples were selected from the master and target calibration sets, respectively, as the standard sample set for spectral standardization and the standardized transfer matrix was established.
ree spectral standardization methods were used to calibrate spectra from the target calibration sets, and the SSER ave of the master and target spectral data after calibration was calculated. Under the three algorithms, the relationship between the number of standard samples and the SSER ave value is shown in Figure 4.
As can be seen intuitively from Figure 4, with the increase in the number of standard samples, the effective  information contained in the standard sample set increases as well. Meanwhile, the SSER ave value decreases, meaning that the spectral difference between the master and target decreases as well. As can be seen from Figure 4(a), in DS algorithm, SSER ave of the three target spectrometers decreases with increase in the number of standard samples to varying degrees. When the number of standard samples is 50, the SSER ave is the lowest. When the number of standard samples is greater than 50, SSER ave from T 1 increases, whilst that from T 2 and T 3 remains largely unchanged. Here, the increase in SSER ave from T 1 is due to overfitting caused by too many samples. As can also be seen from Figure 4(b), in PDS algorithm, SSER ave of the three target spectrometers is the lowest when the standard sample number is 50. When the standard sample number is greater than 50, SSER ave remains largely unchanged. Similarly, it can be seen from Figure 4(c) that, when SLRDS algorithm is used, SSER ave of T 1 decreases significantly with the increase in the standard sample number. Yet, when the standard sample number is greater than 50, SSER ave decreases gently with the standard sample number. erefore, 50 samples were selected to constitute the standard sample set for spectral standardization.

Analysis of Spectral Differences.
Fifty samples were selected to constitute a standard sample set, and DS, PDS, and SLRDS algorithms were used to establish a transfer matrix between the spectra of the standard sample set collected by the master and the target spectrometers. With the help of an established transfer matrix, the spectra of the calibration sample set from the target spectrometers were standardized. e SSER and PCSER of the master and target spectra before and after standardization were calculated, and the average error rate and maximum error rate of SSER and PCSER were compared ( Table 4).
As can be seen from Table 4, SSER and PCSER of untreated target spectra with the master spectra are high, indicating that the master spectra and the target spectra have great differences. is may be due to different NIR spectrometers selected in the test, which could yield significantly different spectra from the same sample. After standardization with DS, PDS, and SLRDS algorithms, the SSER and PCSER of the target spectra with the master spectra are largely reduced and spectral differences between the master and target are reduced to different degrees. In the three target spectrometers, the effect after standardization by the DS algorithm is the best.

Model Sharing.
Using the spectral standardization methods and parameters identified in Section 3.2, the spectra of the target prediction set samples (62) were calibrated. e spectra before and after standardization were input into the established optimal master model of crude protein (Section 3.1) for prediction. e predictive scatter diagram of each spectrometer is shown in Figure 5, and the predictive effect of model sharing is shown in Table 5.
It can be clearly seen from Figure 5(a) that, compared with Y � X, there is a big difference in the intercept of the    original spectra predicted by the master model for the three target spectrometers on the vertical axis, which means that there is a large systematic error in the predictive results. As can be seen from Figures 5(b)-5(d), the predictive effect of the model is improved after standardized target spectra are input again to the master model.
As shown in Table 5, when target spectra without algorithm standardization are input to the master model, RMSEP is high and RPD <1.75, which indicates that the master model has a poor predictive effect on the original target spectra and cannot be directly applied for prediction of target spectra. Instead, when target spectra after standardization by DS, PDS, and SLRDS algorithms are input to the master model, the prediction correlation coefficient increases (all are over 0.8), RMSEP decreases sharply, and RPD also has a certain improvement. is shows that the spectral standardization algorithm greatly reduces the spectral difference between the master and target spectrometers, having achieved satisfactory model sharing. Among the three algorithms, the predictive effect of the target spectra after standardization by the DS algorithm is the best, being consistent with the conclusion from Section 3.2. Based on the DS algorithm, the correlation coefficient of target instruments is greater than 0.9 and RMSEP is less than 1.0, and this model can be used to predict the crude protein content of wheat flour. ese results demonstrate that the proposed two evaluation indexes (i.e., SSER and PCSER) can effectively analyze spectral differences, accurately evaluate the performance of various spectral standardization methods, and greatly facilitate model sharing between different spectrometers.

Conclusion
Taking wheat flour as sample and crude protein NIR spectral calibration model as example, this study explores spectral standardization methods between different NIR spectrometers, seeks the best spectral standardization method, and aims to realize sharing of calibration model among different instruments. e main conclusions are as follows:  (1) Spectral standardization error rate and principal component score error rate were proposed for evaluating effect of spectral standardization, which enabled quantitative evaluation of spectral differences and improvement of accuracy in spectral standardization. e spectral standardization error rate and principal component score error rate proposed can effectively analyze the spectral difference. Compared with traditional spectral standardization and model transfer evaluation methods, these two evaluation indexes can preliminarily evaluate the advantages and disadvantages of spectral standardization methods without completing a whole set of model prediction work, which can save time and provide convenience for model sharing.
(2) DS, PDS, and SLRDS algorithms all belong to supervised spectral standardization algorithms. With the increase in the sample number, effective information contained in the standard sample set increases and SSER ave values of three algorithms show a downward trend. Yet, too many samples could lead to overfitting. Our comparative tests revealed that when 50 samples were selected as the standard sample set for spectral standardization, the error of the NIR calibration model sharing for wheat flour crude protein was the lowest. (3) After standardization by three algorithms, the spectral difference between the three target and the master spectrometers is significantly reduced and the predictive effect of the master model is greatly improved. After standardization by the DS algorithm, the error rate of three target spectrometers was the lowest and the master model had the best effect. Its prediction accuracy was greatly improved compared with that before standardization.

Data Availability
Some of the data used to support the findings of this study are included within the article. Others cannot be shared as the data also form part of an ongoing study.

Disclosure
Jing Tian and Xinyu Chen are co-first authors.

Conflicts of Interest
e authors declare that they have no conflicts of interest.