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

Authors: Jing Tian; Xinyu Chen; Zhennan Liang; Wenliang Qi; Xiaohuan Zheng; Daoli Lu; Bin Chen
Journal: Journal of Food Quality
 (2022)

---

## Abstract

In order to explore spectral standardization methods for spectra collected by different NIR spectrometers, to reduce spectral differences, and to realize model sharing among different instruments, the crude protein content of 154 wheat flour samples was measured using one grating and three Fabry-Perot tunable filter 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 different 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 differences between the master and the target spectra, and the effect of model sharing was evaluated using parameters including prediction correlation coefficient (Rp), root mean square error of prediction (RMSEP), and relative prediction deviation (RPD). The results show the following: (1) The difference between spectra can be quantitatively evaluated through analyzing SSER and PCSER. (2) After standardization by the three algorithms, the spectral difference between the three target and the master spectrometers is significantly reduced and the prediction effect 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 effect. 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 different wavelength ranges, so as to achieve model sharing. Therefore, DS, PDS, and SLRDS algorithms can effectively reduce the spectral differences between different instruments and realize the sharing of NIR calibration models for wheat flour crude protein measurement.


---

## Body

## 1. Introduction

### 1.1. General Process of Model Transfer

Modern near-infrared spectroscopy analysis is an indirect analysis technology, which combines spectrometry measurement technology and chemometrics theory [1–4]. It has the advantages of nondestructive, fast, efficient, and multicomponent simultaneous detection and can realize online detection [5–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. Thus, 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. Therefore, the realization of model sharing between different instruments is of great significance for practical application and promotion of NIR spectroscopy analysis technology [10–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–19]. The methods to realize model transfer can be divided into three categories: The first is to correct the parameters of the prediction model, such as the two-step partial least squares method. The second is to correct the prediction results of the model, such as the slope/deviation algorithm. The 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. Therefore, 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]. Thus, the differences between spectra are reduced, so that the established model can be shared between different instruments. The 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. The smaller the error rate, the smaller the spectra difference of samples. 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.


### 1.2. 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. Therefore, 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. Then, the obtained principal component scores are compared with those of the master spectrometer. The 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 Section2.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. The 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). The optimal standard sample number is decided according to the SSERave 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) The 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. The differences of principal component scores between the corrected target spectra and the master spectra are evaluated. The 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.Figure 1
The flow chart of model sharing based on principal component score evaluation.


## 1.1. General Process of Model Transfer

Modern near-infrared spectroscopy analysis is an indirect analysis technology, which combines spectrometry measurement technology and chemometrics theory [1–4]. It has the advantages of nondestructive, fast, efficient, and multicomponent simultaneous detection and can realize online detection [5–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. Thus, 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. Therefore, the realization of model sharing between different instruments is of great significance for practical application and promotion of NIR spectroscopy analysis technology [10–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–19]. The methods to realize model transfer can be divided into three categories: The first is to correct the parameters of the prediction model, such as the two-step partial least squares method. The second is to correct the prediction results of the model, such as the slope/deviation algorithm. The 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. Therefore, 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]. Thus, the differences between spectra are reduced, so that the established model can be shared between different instruments. The 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. The smaller the error rate, the smaller the spectra difference of samples. 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.


## 1.2. 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. Therefore, 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. Then, the obtained principal component scores are compared with those of the master spectrometer. The 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 Section2.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. The 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). The optimal standard sample number is decided according to the SSERave 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) The 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. The differences of principal component scores between the corrected target spectra and the master spectra are evaluated. The 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.Figure 1
The flow chart of model sharing based on principal component score evaluation.


## 2. Materials and Methods

### 2.1. Samples

Wheat flour samples used in this experiment are of different commercial brands including Golden Dragon, Jinshahe, Zhanyi, Anqi, etc., from different regions of China. They belong to five categories: low-gluten flour, medium-gluten 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. The 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.” The 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. The 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 jointX-Y distance) algorithm. The test results of crude protein content in wheat flour of each set are shown in Table 1.Table 1
Distribution of crude protein content in wheat flour of different sample sets.
Sample setNumberScope/% (w/w)Average/% (w/w)Standard deviationCoefficient of variationTotal set1546.71∼14.8310.161.780.18Calibration set926.71∼14.8310.201.920.19Prediction set627.02∼14.4010.171.570.15


### 2.2. 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 T1, T2, and T3). The wavelength range and sampling interval of the NIR spectrometers are shown in Table 2.Table 2
Spectral wavelength range and sampling interval of NIR spectrometers.
NIR spectrometersManufacturerSpectroscopic principleWavelength/nmWavelength interval/nmS450Shanghai Lengguang Technology Co., Ltd.Dispersive scanning900 ∼ 2 5002N500Jinan Hanon future Technology Co., Ltd.Fabry–Perot interferometer1 550 ∼ 1 9502For 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. The average spectra of samples collected by the master and target spectrometers are shown in Figure2.Figure 2
Average spectra of all samples collected by the master and target spectrometers.


### 2.3. Analysis Method

#### 2.3.1. Spectral Standardization Methods

DS, PDS, and SLRDS algorithms were used to standardize spectra for realizing model sharing among different NIR spectrometers. The 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. The 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]. The width of the left and right wavelength window region (ω) was set to 3 in the test. The 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.


#### 2.3.2. 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.The spectral standardization error rate for a sample is defined as(1)SSERi=∑j=1KMij−TijMij+Tij×100%,in which {Mij, i = 1,…,N, j = 1,…,K} is the sample spectral matrix of the master spectrometer; {Tij, 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 SSERave and maximum error rate SSERmax are defined as(2)SSERave=1N∑i=1NSSERi,SSERmax=maxSSERi.(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. The calibration model based on principal component analysis or the partial least square method has a better sharing effect.The PCSER formula of the firstn principal component scores between master and target spectra of a sample is as follows:(3)PCSER=1n∑i=1nWiTm,i−Tt,i2,in which Tm, i is the score rate of the ith principal component of the master spectrum; Tt, i is the score rate of the ith principal component of the target spectrum after standardization of the corresponding spectrum; and Wi is the contribution rate of the ith principal component.For all sample sets, the average error rate PCSERave and maximum error rate PCSERmax are defined as(4)PCSERave=1N∑i=1NPCSERi,PCSERmax=maxPCSERi.


#### 2.3.3. Evaluation of Model Performance

In the process of model establishment, corrected correlation coefficient (Rc), 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 (Rp), root mean square error of prediction (RMSEP), and relative prediction deviation (RPD). The smaller the RMSEC, RMSECV, and RMSEP are and the closer Rc and Rp 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].


### 2.4. Data Processing and Analysis

The 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. The NIRSA 5.8.8 system was independently developed by the NIR Laboratory of Jiangsu University.


## 2.1. Samples

Wheat flour samples used in this experiment are of different commercial brands including Golden Dragon, Jinshahe, Zhanyi, Anqi, etc., from different regions of China. They belong to five categories: low-gluten flour, medium-gluten 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. The 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.” The 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. The 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 jointX-Y distance) algorithm. The test results of crude protein content in wheat flour of each set are shown in Table 1.Table 1
Distribution of crude protein content in wheat flour of different sample sets.
Sample setNumberScope/% (w/w)Average/% (w/w)Standard deviationCoefficient of variationTotal set1546.71∼14.8310.161.780.18Calibration set926.71∼14.8310.201.920.19Prediction set627.02∼14.4010.171.570.15


## 2.2. 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 T1, T2, and T3). The wavelength range and sampling interval of the NIR spectrometers are shown in Table 2.Table 2
Spectral wavelength range and sampling interval of NIR spectrometers.
NIR spectrometersManufacturerSpectroscopic principleWavelength/nmWavelength interval/nmS450Shanghai Lengguang Technology Co., Ltd.Dispersive scanning900 ∼ 2 5002N500Jinan Hanon future Technology Co., Ltd.Fabry–Perot interferometer1 550 ∼ 1 9502For 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. The average spectra of samples collected by the master and target spectrometers are shown in Figure2.Figure 2
Average spectra of all samples collected by the master and target spectrometers.


## 2.3. Analysis Method

### 2.3.1. Spectral Standardization Methods

DS, PDS, and SLRDS algorithms were used to standardize spectra for realizing model sharing among different NIR spectrometers. The 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. The 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]. The width of the left and right wavelength window region (ω) was set to 3 in the test. The 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.


### 2.3.2. 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.The spectral standardization error rate for a sample is defined as(1)SSERi=∑j=1KMij−TijMij+Tij×100%,in which {Mij, i = 1,…,N, j = 1,…,K} is the sample spectral matrix of the master spectrometer; {Tij, 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 SSERave and maximum error rate SSERmax are defined as(2)SSERave=1N∑i=1NSSERi,SSERmax=maxSSERi.(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. The calibration model based on principal component analysis or the partial least square method has a better sharing effect.The PCSER formula of the firstn principal component scores between master and target spectra of a sample is as follows:(3)PCSER=1n∑i=1nWiTm,i−Tt,i2,in which Tm, i is the score rate of the ith principal component of the master spectrum; Tt, i is the score rate of the ith principal component of the target spectrum after standardization of the corresponding spectrum; and Wi is the contribution rate of the ith principal component.For all sample sets, the average error rate PCSERave and maximum error rate PCSERmax are defined as(4)PCSERave=1N∑i=1NPCSERi,PCSERmax=maxPCSERi.


### 2.3.3. Evaluation of Model Performance

In the process of model establishment, corrected correlation coefficient (Rc), 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 (Rp), root mean square error of prediction (RMSEP), and relative prediction deviation (RPD). The smaller the RMSEC, RMSECV, and RMSEP are and the closer Rc and Rp 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].


## 2.3.1. Spectral Standardization Methods

DS, PDS, and SLRDS algorithms were used to standardize spectra for realizing model sharing among different NIR spectrometers. The 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. The 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]. The width of the left and right wavelength window region (ω) was set to 3 in the test. The 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.


## 2.3.2. 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.The spectral standardization error rate for a sample is defined as(1)SSERi=∑j=1KMij−TijMij+Tij×100%,in which {Mij, i = 1,…,N, j = 1,…,K} is the sample spectral matrix of the master spectrometer; {Tij, 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 SSERave and maximum error rate SSERmax are defined as(2)SSERave=1N∑i=1NSSERi,SSERmax=maxSSERi.(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. The calibration model based on principal component analysis or the partial least square method has a better sharing effect.The PCSER formula of the firstn principal component scores between master and target spectra of a sample is as follows:(3)PCSER=1n∑i=1nWiTm,i−Tt,i2,in which Tm, i is the score rate of the ith principal component of the master spectrum; Tt, i is the score rate of the ith principal component of the target spectrum after standardization of the corresponding spectrum; and Wi is the contribution rate of the ith principal component.For all sample sets, the average error rate PCSERave and maximum error rate PCSERmax are defined as(4)PCSERave=1N∑i=1NPCSERi,PCSERmax=maxPCSERi.


## 2.3.3. Evaluation of Model Performance

In the process of model establishment, corrected correlation coefficient (Rc), 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 (Rp), root mean square error of prediction (RMSEP), and relative prediction deviation (RPD). The smaller the RMSEC, RMSECV, and RMSEP are and the closer Rc and Rp 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].


## 2.4. Data Processing and Analysis

The 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. The NIRSA 5.8.8 system was independently developed by the NIR Laboratory of Jiangsu University.


## 3. Results and Discussion

### 3.1. Model Building for the Master Spectrometer

The 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. The 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 Table3.Table 3
Evaluation of the PLS calibration model for sample protein under different pretreatment methods.
Pretreatment methodNumber of principal componentsCalibration setPrediction setRPDRcRMSECRpRMSEPNone70.960.500.930.613.38SNV80.970.480.940.514.09Normalization60.970.490.930.573.97MSC90.970.480.930.573.97Normalization + MSC70.970.460.960.434.221st derivative50.960.540.940.543.59It can be clearly seen from Table3 that, after comparing the modeling effects of different pretreatment methods, when the principal component number is 7, the crude protein calibration model after Normalization + MSC pretreatment has the best effect. At this condition, the PLS model has an Rc of 0.97, an RMSEC of 0.46, an Rp of 0.96, an RMSEP of 0.43, and an RPD of 4.22. RPD = 4.22 indicates that the calibration model is strong enough for accurate predictions of future unknown samples. The regression coefficient of this model is shown in Figure 3.Figure 3
Regression coefficient diagram of the optimal crude protein model.Ainara López used the AOTF-NIR Analyser (Brimrose) to predict the crude protein content of potatoes in the 1,100 ∼ 2,300 nm. The correlation coefficients of 0.95 and 0.88 were obtained for calibration and validation. The 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 Rp and RMSEP were 0.94 and 0.28 [26]. The Rp 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.


### 3.2. 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. Three spectral standardization methods were used to calibrate spectra from the target calibration sets, and the SSERave 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 SSERave value is shown in Figure 4.Figure 4
Variation of SSERave of the three target spectrometers with the number of standard samples from three spectral standardization methods. (a) DS algorithm. (b) PDS algorithm. (c) SLRDS algorithm.
(a)(b)(c)As can be seen intuitively from Figure4, with the increase in the number of standard samples, the effective information contained in the standard sample set increases as well. Meanwhile, the SSERave 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, SSERave 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 SSERave is the lowest. When the number of standard samples is greater than 50, SSERave from T1 increases, whilst that from T2 and T3 remains largely unchanged. Here, the increase in SSERave from T1 is due to overfitting caused by too many samples. As can also be seen from Figure 4(b), in PDS algorithm, SSERave of the three target spectrometers is the lowest when the standard sample number is 50. When the standard sample number is greater than 50, SSERave remains largely unchanged. Similarly, it can be seen from Figure 4(c) that, when SLRDS algorithm is used, SSERave of T1 decreases significantly with the increase in the standard sample number. Yet, when the standard sample number is greater than 50, SSERave decreases gently with the standard sample number. Therefore, 50 samples were selected to constitute the standard sample set for spectral standardization.


### 3.3. 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. The 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 (Table4).Table 4
Differences between the target and master spectra before and after standardization.
SpectrometerAlgorithmSSERPCSERSSERaveSSERmaxPCSERavePCSERmaxT1None81.0290.6188.50106.04DS0.547.333.6715.43PDS0.7713.194.5717.99SLRDS1.4114.564.9418.84T2None48.7357.1621.3238.12DS0.592.923.6516.13PDS0.813.113.9017.00SLRDS0.813.113.9016.99T3None47.3051.108.4322.72DS0.502.344.1515.98PDS0.972.664.7714.83SLRDS0.992.804.4815.00As can be seen from Table4, 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. This 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.


### 3.4. Model Sharing

Using the spectral standardization methods and parameters identified in Section3.2, the spectra of the target prediction set samples (62) were calibrated. The spectra before and after standardization were input into the established optimal master model of crude protein (Section 3.1) for prediction. The predictive scatter diagram of each spectrometer is shown in Figure 5, and the predictive effect of model sharing is shown in Table 5.Figure 5
Predictive scatter plot of the crude protein calibration model. (a) Before standardization. (b) After standardization of T1. (c) After standardization of T2. (d) After standardization of T3.
(a)(b)(c)(d)Table 5
Effect of model sharing.
SpectrometerAlgorithmModel sharingRpRMSEPRPDT1None0.49113.041.15DS0.900.822.34PDS0.831.241.80SLRDS0.822.291.76T2None0.6792.641.35DS0.950.573.16PDS0.861.031.95SLRDS0.871.032.02T3None0.7176.651.41DS0.910.752.43PDS0.881.062.09SLRDS0.861.071.94It can be clearly seen from Figure5(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 Table5, 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. This 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. These 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.


## 3.1. Model Building for the Master Spectrometer

The 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. The 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 Table3.Table 3
Evaluation of the PLS calibration model for sample protein under different pretreatment methods.
Pretreatment methodNumber of principal componentsCalibration setPrediction setRPDRcRMSECRpRMSEPNone70.960.500.930.613.38SNV80.970.480.940.514.09Normalization60.970.490.930.573.97MSC90.970.480.930.573.97Normalization + MSC70.970.460.960.434.221st derivative50.960.540.940.543.59It can be clearly seen from Table3 that, after comparing the modeling effects of different pretreatment methods, when the principal component number is 7, the crude protein calibration model after Normalization + MSC pretreatment has the best effect. At this condition, the PLS model has an Rc of 0.97, an RMSEC of 0.46, an Rp of 0.96, an RMSEP of 0.43, and an RPD of 4.22. RPD = 4.22 indicates that the calibration model is strong enough for accurate predictions of future unknown samples. The regression coefficient of this model is shown in Figure 3.Figure 3
Regression coefficient diagram of the optimal crude protein model.Ainara López used the AOTF-NIR Analyser (Brimrose) to predict the crude protein content of potatoes in the 1,100 ∼ 2,300 nm. The correlation coefficients of 0.95 and 0.88 were obtained for calibration and validation. The 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 Rp and RMSEP were 0.94 and 0.28 [26]. The Rp 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.


## 3.2. 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. Three spectral standardization methods were used to calibrate spectra from the target calibration sets, and the SSERave 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 SSERave value is shown in Figure 4.Figure 4
Variation of SSERave of the three target spectrometers with the number of standard samples from three spectral standardization methods. (a) DS algorithm. (b) PDS algorithm. (c) SLRDS algorithm.
(a)(b)(c)As can be seen intuitively from Figure4, with the increase in the number of standard samples, the effective information contained in the standard sample set increases as well. Meanwhile, the SSERave 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, SSERave 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 SSERave is the lowest. When the number of standard samples is greater than 50, SSERave from T1 increases, whilst that from T2 and T3 remains largely unchanged. Here, the increase in SSERave from T1 is due to overfitting caused by too many samples. As can also be seen from Figure 4(b), in PDS algorithm, SSERave of the three target spectrometers is the lowest when the standard sample number is 50. When the standard sample number is greater than 50, SSERave remains largely unchanged. Similarly, it can be seen from Figure 4(c) that, when SLRDS algorithm is used, SSERave of T1 decreases significantly with the increase in the standard sample number. Yet, when the standard sample number is greater than 50, SSERave decreases gently with the standard sample number. Therefore, 50 samples were selected to constitute the standard sample set for spectral standardization.


## 3.3. 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. The 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 (Table4).Table 4
Differences between the target and master spectra before and after standardization.
SpectrometerAlgorithmSSERPCSERSSERaveSSERmaxPCSERavePCSERmaxT1None81.0290.6188.50106.04DS0.547.333.6715.43PDS0.7713.194.5717.99SLRDS1.4114.564.9418.84T2None48.7357.1621.3238.12DS0.592.923.6516.13PDS0.813.113.9017.00SLRDS0.813.113.9016.99T3None47.3051.108.4322.72DS0.502.344.1515.98PDS0.972.664.7714.83SLRDS0.992.804.4815.00As can be seen from Table4, 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. This 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.


## 3.4. Model Sharing

Using the spectral standardization methods and parameters identified in Section3.2, the spectra of the target prediction set samples (62) were calibrated. The spectra before and after standardization were input into the established optimal master model of crude protein (Section 3.1) for prediction. The predictive scatter diagram of each spectrometer is shown in Figure 5, and the predictive effect of model sharing is shown in Table 5.Figure 5
Predictive scatter plot of the crude protein calibration model. (a) Before standardization. (b) After standardization of T1. (c) After standardization of T2. (d) After standardization of T3.
(a)(b)(c)(d)Table 5
Effect of model sharing.
SpectrometerAlgorithmModel sharingRpRMSEPRPDT1None0.49113.041.15DS0.900.822.34PDS0.831.241.80SLRDS0.822.291.76T2None0.6792.641.35DS0.950.573.16PDS0.861.031.95SLRDS0.871.032.02T3None0.7176.651.41DS0.910.752.43PDS0.881.062.09SLRDS0.861.071.94It can be clearly seen from Figure5(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 Table5, 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. This 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. These 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.


## 4. 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. The 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. The 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 SSERave 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.



---

*Source: 9009756-2022-04-12.xml*