A method for predicting the farinographic properties of wheat flour
By combining Gaussian process regression and partial least squares regression models, the prediction method for wheat flour properties was optimized, solving the problems of insufficient prediction efficiency and accuracy in traditional methods, and achieving more efficient and accurate prediction of flour properties.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-08
- Publication Date
- 2026-03-20
AI Technical Summary
Existing methods for predicting the properties of wheat flour are insufficient in terms of prediction efficiency and accuracy. Traditional partial least squares regression algorithms suffer from over-reliance on initial input data and over-optimization in data processing and model optimization, resulting in poor prediction performance.
A Gaussian process regression model was used to preprocess and reduce the dimensionality of near-infrared spectral data. Features were extracted through principal component analysis, two partial least squares regression models were established in groups, and the results were fused using the Sigmoid function to optimize the extraction and utilization of data features.
It improves the accuracy and efficiency of wheat flour properties prediction, has a wider range of applications, is suitable for different wheat flour spectral datasets, and reduces over-optimization operations in the preprocessing and data input stages.
Smart Images

Figure CN115630332B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to a method for predicting the farinograph property of wheat flour and belongs to the field of quality detection of agricultural products. BACKGROUND
[0002] The near-infrared spectrum analysis technology is one of the most rapidly developed high-tech analysis technologies in the past decade. With the advantages of rapidness, simplicity, high efficiency and the like, the technology is recognized and accepted by people and is widely applied to the wheat flour industry to predict ingredient parameters such as moisture, protein, ash content and wet gluten content. With higher requirements for the color, taste and shelf life of wheat food, the farinograph property of wheat flour is also listed as a main detection index. Under the traditional method, the farinograph property is measured by a farinograph. The farinograph gives four important parameters including water absorption, development time, stability time and degree of softening according to the process of forming dough by flour in the instrument. Nowadays, the farinograph property of wheat flour can be quickly and non-destructively detected by using the near-infrared spectrum combined with machine learning. The method is to use the regression algorithm of machine learning to train the near-infrared spectrum data to establish a prediction model. The regression algorithms applied in the near-infrared spectrum analysis technology currently include multiple linear regression, principal component regression and partial least squares regression.
[0003] The partial least squares regression algorithm is a regression algorithm of multiple independent variables to multiple dependent variables. In the modeling process, the algorithm integrates the characteristics of principal component analysis, canonical correlation analysis and linear regression analysis to improve the prediction effect. The prediction model established by the ordinary partial least squares regression has good prediction response, but there are deficiencies in the screening and analysis of input variables. In the application of the near-infrared spectrum nowadays, the accuracy of the prediction model cannot meet the requirements.
[0004] In order to improve the prediction accuracy of partial least squares regression algorithm, many scholars have made relevant improvements to the traditional partial least squares regression algorithm combined with actual problems. Yang Linyu et al. combined genetic algorithm with partial least squares regression, and selected spectral features by genetic algorithm as input variables of partial least squares regression, to improve the accuracy of the prediction model (Yang Linyu, Ding Yu, Zhan Ye, Zhu Shaonong, Chen Yujuan, Deng Fan, Zhao Xingqiang. Quantitative analysis of Mn and Ni elements in steel based on LIBS and GA-PLS[J]. Spectroscopy and Spectral Analysis, 2022, 42(06): 1804-1808.). Liu Meizhi et al. introduced the step of removing outliers, found abnormal data before modeling, and improved the accuracy of modeling data (Liu Meizhi, Yang Lei. A partial least squares fault monitoring method for removing outliers[J]. Journal of Shanxi Datong University (Natural Science Edition), 2022, 38(02): 11-15.). Zhu Shaonong et al. integrated the band interval selection method into partial least squares regression, and selected the best spectral band for partial least squares regression (Zhu Shaonong, Ding Yu, Chen Yujuan, Deng Fan, Chen Feifan, Yan Fei. Quantitative analysis of Cu and Ni in oil-containing soil based on LIBS and variable selection PLS[J]. Spectroscopy and Spectral Analysis, 2020, 40(12): 3812-3817.). He Wenzheng et al. combined orthogonal signal correction method with partial least squares regression, removed irrelevant spectral orthogonal components by orthogonal signal correction method first, and then established a prediction model to improve the prediction accuracy (He Wenzheng, Lei Jinyu, Lu Xianyong, Chen Ting. Plant oil identification method based on R language and orthogonal partial least squares discriminant analysis[P]. Fujian Province: CN113392586A, 2021-09-14.
[0005] Although the above schemes can improve the prediction accuracy to some extent, the improvement of the method is concentrated in the preprocessing stage and the data input algorithm model stage, which is easy to produce over-optimization and weaken the effect. Although the combination of genetic algorithm and partial least squares regression optimizes the data input of the algorithm, it is too dependent on the initial input data, and it is easy to converge quickly and lose some original data features, especially when the data volume is large; and the removal of outliers and the selection of band interval are to remove the interference of part of abnormal values and enhance the expression of dominant features in the preprocessing stage and data input stage, and the data preprocessing and partial least squares method itself has this ability; the combination of orthogonal signal correction method and partial least squares regression is also an optimization of the data preprocessing stage, and other synchronous preprocessing methods can also achieve similar effects, resulting in that the orthogonal signal correction method does not obviously improve the prediction effect of the model.
[0006] In summary, although the existing prediction methods can improve the prediction effect to some extent, the prediction efficiency and prediction accuracy still need to be improved. SUMMARY
[0007] In order to solve the problem of low prediction efficiency and prediction accuracy of the flour powder property, the application provides a wheat flour powder property prediction method, comprising:
[0008] Step 1: Obtain the near-infrared spectrum data of the wheat flour and pretreat it;
[0009] Step 2: Perform principal component analysis on the pretreated near-infrared spectrum data of the wheat flour, and extract the first several principal components as the dimension-reduced spectrum data;
[0010] Step 3: Use the Gaussian process regression model to predict the dimension-reduced spectrum data, and obtain the prediction label data of the Gaussian process regression;
[0011] Step 4: Input the prediction label data of the Gaussian process regression into the improved partial least squares regression model, and obtain the final wheat flour property prediction result;
[0012] The improved partial least squares regression model comprises two partial least squares regression models, which respectively predict the prediction label data of the Gaussian process regression and respectively obtain the prediction results Y pre1 and Y pre2 , and the final wheat flour property prediction result is obtained based on the weighted fusion of Y pre1 and Y pre2 .
[0013] Optionally, the improved partial least squares regression model is obtained based on the historical prediction label data set of the Gaussian process regression model, and the modeling process comprises:
[0014] Step 41: Select a grouping threshold for the historical prediction label data set;
[0015] Step 42: Based on the grouping threshold, the near-infrared spectrum data of the wheat flour corresponding to the historical prediction label data is divided into two groups with similar number, one group of prediction label data is lower than the grouping threshold, and the other group of prediction label data is greater than or equal to the grouping threshold;
[0016] Step 43: Respectively establish a partial least squares regression model for the two groups of data.
[0017] Optionally, the method uses a Sigmoid function as a probability prediction function to fuse the prediction results of the two partial least squares regression models, and the formula of the Sigmoid function is:
[0018]
[0019] Wherein, x=σ is the threshold point of the Sigmoid function, which is also the grouping threshold for dividing the historical prediction label data of the Gaussian process regression into two groups, and the grouping threshold corresponds to an output value of 0.5, ω is the weight value of the Sigmoid function, and changing the weight value ω makes the function adapt to different label data ranges;
[0020] The prediction result of the Gaussian process regression is substituted into the Sigmoid function to obtain the probability of the prediction result falling on the two partial least squares regression models respectively, and the final prediction result is obtained by fusing the probabilities as weights, and the fusion formula is:
[0021]
[0022] In the formula, is the prediction result of the Gaussian process regression.
[0023] Optionally, the preprocessing process in step 1 comprises:
[0024] Step 11: Perform standard normal transformation processing on each collected wheat flour near-infrared spectrum data, and the formula is:
[0025]
[0026] In the formula, x=[x1, x2, …, x m ] is the original wheat flour near-infrared spectrum data, m is the number of sampling points of the spectrum, i.e., the dimension, x k is the value of the kth sampling point of the spectrum;
[0027] Step 22: Perform multivariate scatter correction processing on the spectrum after standard normal transformation processing, and if there are n pieces of collected spectrum data, the data set to be processed by multivariate scatter correction is:
[0028] X snv =[ x s nv,1 ,x snv,2 ,…,x snv,n ]
[0029] Wherein, x snv,1 ,x snv,2 ,…,x snv,n are the spectrum data processed by standard normal transformation;
[0030] First, the average value of all spectrum data is obtained as an ideal spectrum, and the formula is:
[0031]
[0032] Secondly, monadic linear regression is performed between the spectrum of each sample and the average spectrum, and the baseline shift b of each sample is obtained by solving the least square problem i and the offset k i , and the formula is as follows:
[0033]
[0034] Finally, the spectrum of each sample is corrected, and the formula is as follows:
[0035]
[0036] The spectrum data set after the multivariate scattering correction processing is X pt =[x snvmsc,1 ,x snvmsc,2 ,…,x snvmsc,n ].
[0037] Optionally, the process of performing principal component analysis in step 2 comprises the following steps.
[0038] Step 21: the preprocessed wheat flour near-infrared spectrum data is represented by a matrix X pt ∈R n×m , representing n samples with m-dimensional characteristic variables, and the form is as follows:
[0039]
[0040] wherein x ij represents the jth variable of the ith sample, and x ij is standardized to obtain:
[0041]
[0042] In the formula, μj is the mean of the jth variable of all samples, and S j is the variance thereof;
[0043] Step 22: x ij is replaced by , and X pt is converted to , and the form is as follows:
[0044]
[0045] The covariance matrix of is decomposed as follows:
[0046]
[0047] In the formula, Λ is a diagonal matrix composed of eigenvalues of R, Λ = diag[λ1, λ2, …, λm ], U is the eigenvector matrix, each column u1, u2, …, u m is an eigenvector.
[0048] According to the eigenvalue λ j of the correlation coefficient matrix R j , the cumulative interpretation rate W is calculated, and the formula is:
[0049]
[0050] In the formula, λ j is the eigenvalue corresponding to the correlation coefficient matrix;
[0051] Step 23: Combined with the cumulative interpretation rate W j and the actual demand, the dimension of X pt is reduced, and the principal component in this dimension is obtained, and for each sample The dimension reduction formula is:
[0052]
[0053] In the formula, y i is the component obtained by reducing the i-th near-infrared data to k dimensions;
[0054] Through principal component analysis, the original representative pretreated near-infrared data matrix X pt is converted into Y pca = [y1, y2, …, y n ] with lower dimension.
[0055] Optionally, the process of establishing the Gaussian process regression model comprises:
[0056] The spectral data X pca after principal component analysis dimension reduction is taken as the input of the Gaussian process regression, and when f(Y) = [f(y1), f(y2), …, f(y n )] all conform to the multivariate Gaussian distribution, f(y) is a Gaussian process, and the formula is:
[0057] f(y) ~ N(μ(y), κ(y, y))
[0058] In the formula, μ(y) represents the mean of each dimension of the spectral data, and κ(y, y) is a covariance function, that is, a kernel function, and the basic form is:
[0059]
[0060] In the formula, σ and l are hyperparameters of the kernel function.
[0061] The above Gaussian process is taken as the prior of the Gaussian process, and is expressed as f(y) ~ N(μf , K ff );
[0062] The combination of the reduced near-infrared spectrum data and the label data (y * , z * ) is substituted into the Gaussian process prior, and z * and f(y) are subject to a joint Gaussian distribution, which is expressed as:
[0063]
[0064] In the formula, K ff = κ(y, y), K fy = κ(y, y * ), and K zz = κ(y * , y * ), so that
[0065]
[0066] The above formula realizes Gaussian process regression and obtains the mean and the covariance
[0067] Then, by the maximum likelihood estimation method, the hyperparameters σ and l of the Gaussian kernel function are determined by maximizing the probability of the occurrence of z, and the formula is:
[0068]
[0069] Finally, X pca is substituted into the Gaussian process posterior to obtain the predicted label data of the Gaussian process regression
[0070] Optionally, the step 43 of establishing a partial least squares regression model process for the two groups of data includes:
[0071] After grouping, one group of near-infrared spectrum data matrices is X pt1 = [x1, x2, …, x p ] m×p , indicating that there are p m-dimensional near-infrared data samples, and the label matrix is Z = [z1, z2, …, z p ] n×p , indicating the powder property data corresponding to the near-infrared spectrum data samples, and X and Y are respectively standardized, and the formula is:
[0072]
[0073] Wherein, s x,jand They represent x respectively j Standard deviation and mean s z,j and They represent y respectively j The standard deviation and mean;
[0074] Next, calculate the first component t1 of E0 and the first component u1 of F0. To maximize the correlation between t1 and u1, the inner product θ1 must be maximized, as shown in the formula:
[0075]
[0076] Where w1 is composed of matrix The eigenvector corresponding to the largest eigenvalue is obtained. The first pair of components can be obtained from w1 and v1:
[0077]
[0078] The regression equations for E0 and F0 on t1 are:
[0079]
[0080] Where E1 and F1 are the residual matrices, and α1 and β1 are the regression coefficient vectors, the formula is:
[0081]
[0082] Replacing E0 and F0 with E1 and F1 respectively, and repeating the above steps, we can obtain the second pair of components t2=E1ω2 and u2=F1v2. Then the regression equations of E1 and F1 on t2 are:
[0083]
[0084] If the rank of E0 is r, then there exist r components t1, t2, ..., t r And the regression equation is:
[0085]
[0086] t k =w k1 x1+w k2 x2+…+w kp x p Substituting Y = t1β1 + t2β2 + ... + t r β r (k = 1, 2, ..., r), thus obtaining the partial least squares regression equation with p labels:
[0087]
[0088] The partial least squares regression equation is cross-validated by intercepting the first h components t1, t2, …, t h , defined as follows:
[0089]
[0090] After each extraction of components, the above formula is used for inspection, and when , the extraction of components is stopped, and epsilon is the set accuracy requirement; in the above formula:
[0091]
[0092]
[0093] , wherein, is the fitting value of the ith sample point.
[0094] Optionally, the method uses the corrected root mean square error RMSE as an evaluation index to evaluate the prediction ability, and the formula is:
[0095]
[0096] In the formula, z i is the true label value, is the final predicted label value.
[0097] Optionally, the flour quality characteristics of the wheat flour include water absorption, development time, stability time, and degree of softening.
[0098] The present application has the following advantages:
[0099] The wheat flour quality characteristic prediction method of the present application adds a fuzzy classification of Gaussian process regression after the preprocessing stage, establishes two partial least squares models respectively and fuses the results, optimizes the extraction and utilization of data characteristics, reduces the inefficient process of repeated optimization of similar methods, compared with the traditional and existing improved partial least squares method, the present application classifies the original data into two categories, lets the data with more similar characteristics belong to one category and establishes a partial least squares model respectively, then fuses the results, fully utilizes the data characteristics and avoids the over-optimization operation in the preprocessing stage and data input stage, not only can effectively improve the prediction accuracy, but also obviously improves the prediction efficiency, at the same time, the present application has a wider application range and is also applicable to different and more general other wheat flour spectrum data sets. BRIEF DESCRIPTION OF DRAWINGS
[0100] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments will be briefly introduced. Obviously, the drawings in the following description only constitute some embodiments of the present application, and for those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.
[0101] Figure 1 is a near-infrared raw spectrum and a pretreated spectrum contrast chart of the second embodiment of the present application.
[0102] Figure 2 is a regression chart of two partial least squares models after grouping in the second embodiment of the present application.
[0103] Figure 3 is a sigmoid function probability prediction chart of the present application.
[0104] Figure 4 is a regression contrast chart of the prediction method of the present application and the traditional prediction method. DETAILED DESCRIPTION
[0105] In order to make the objects, technical solutions and advantages of the present application more clear, the embodiments of the present application will be further described in detail below with reference to the drawings.
[0106] Embodiment one:
[0107] The present embodiment provides a wheat flour quality characteristic prediction method, the method comprising:
[0108] Step 1: obtaining wheat flour near-infrared spectrum data and pretreating the same;
[0109] Step 2: performing principal component analysis on the pretreated wheat flour near-infrared spectrum data, and extracting the first several principal components as the reduced-dimension spectrum data;
[0110] Step 3: using a Gaussian process regression model to predict the reduced-dimension spectrum data, and obtaining Gaussian process regression prediction label data;
[0111] Step 4: inputting the Gaussian process regression prediction label data into an improved partial least squares regression model, and obtaining the final wheat flour quality characteristic prediction result;
[0112] The improved partial least squares regression model comprises two partial least squares regression models, which respectively predict the Gaussian process regression prediction label data and respectively obtain prediction results Y pre1 and Y pre2 , and the final wheat flour quality characteristic prediction result is obtained based on the weighted fusion of Y pre1 and Y pre2 .
[0113] Example 2:
[0114] This embodiment provides a method for predicting the flour properties of wheat flour, which uses an improved partial least squares regression method to predict the flour properties of wheat flour based on near-infrared spectral data.
[0115] The main characteristics of wheat flour include four aspects: water absorption rate, formation time, stability time, and degree of weakening.
[0116] By introducing Gaussian process regression, the input variables of partial least squares regression are fuzzily classified, and partial least squares regression models are established for the two categories. The results are then fused using the Sigmoid function. The construction process of the mathematical model based on this method is mainly divided into the following parts.
[0117] 1. Data Preprocessing
[0118] Directly collected near-infrared spectral data of wheat flour is subject to interference from factors such as noise and baseline drift. Data preprocessing can effectively eliminate these interferences. This embodiment performs two-step preprocessing on the data, including standard normal transformation and multivariate scattering correction, as detailed below.
[0119] (1) First, perform a standard normal transformation on each collected spectral data, using the following formula:
[0120]
[0121] In the formula, x = [x1, x2, ..., x... m [This refers to the original near-infrared spectral data of wheat flour.] m is the number of sampling points in the spectrum, i.e., the dimension, x k This is the value of the k-th sampling point of this spectrum;
[0122] (2) Replace the original spectrum with the spectrum processed by standard normal transformation and perform multivariate scattering correction. If there are n collected spectral data points, the dataset is:
[0123] X snv =[x snv,1 x snv,2 , ..., x snv,n ]
[0124] Where, x snv,1 x snv,2 , ..., x snv,n Spectral data processed by standard normal transformation;
[0125] First, calculate the average value of all spectral data. As an ideal spectrum, the formula is:
[0126]
[0127] Secondly, the spectrum of each sample is linearly regressed with the average spectrum, and the baseline shift b and offset k of each sample are solved by solving the least square problem i i The formula is:
[0128]
[0129] Finally, the spectrum of each sample is corrected, and the formula is:
[0130]
[0131] The multi-scattering correction processed spectral data set is X pt = [x snvmsc,1 , x snvmsc,2 , …, x snvmsc,n ].
[0132] 2. Feature extraction
[0133] The feature information contained in each sampling point of the spectral data is mutually high and low. The method of principal component analysis is used to reduce the dimension of the data set X, and the components after dimension reduction are used as the feature input of Gaussian process regression. The specific steps are as follows:
[0134] The preprocessed near-infrared spectral data matrix X pt ∈ R n×m , representing n samples with m-dimensional characteristic variables, has the following form.
[0135]
[0136] Where x ij represents the jth variable of the ith sample. After standardizing x ij , we get:
[0137]
[0138] In the formula, is the mean of the jth variable of all samples, and S j is its variance;
[0139] Replace x ij with , then X pt is transformed into , which has the following form:
[0140]
[0141] The covariance matrix of is Eigenvalue decomposition:
[0142]
[0143] In the formula, Λ is a diagonal matrix composed of the eigenvalues of R, Λ=diag[λ1,λ2,…,λ m U is the eigenvector matrix, and its columns u1, u2, ..., u3 are... m These are the eigenvectors.
[0144] Based on the eigenvalues λ of the correlation coefficient matrix R... j Calculate the cumulative explanatory power W j The formula is:
[0145]
[0146] In the formula, λ j These are the eigenvalues corresponding to the correlation coefficient matrix;
[0147] Finally, combining the cumulative explanatory power W j Based on actual needs, choose X. pt Reduce the dimensionality and find the principal components in this new dimensionality for each sample. The dimensionality reduction formula is:
[0148]
[0149] In the formula, y i The component obtained by reducing the i-th near-infrared data to k dimensions;
[0150] Principal component analysis revealed that the original matrix X represents the preprocessed near-infrared data matrix. pt Transformed into a lower-dimensional Y pca = [y1, y2, ..., x n ].
[0151] 3. Fuzzy classification using Gaussian process regression
[0152] Data Y after dimensionality reduction using principal component analysis pca Instead of the original near-infrared data, use it as the input for Gaussian process regression, when f(Y) = [f(y1), f(y2), ..., f(y... n If all y follows a multivariate Gaussian distribution, then f(y) is a Gaussian process, and its formula is:
[0153] f(y)~N(μ(y),κ(y,y))
[0154] In the formula, μ(y) represents the mean of each dimension of the spectral data, and κ(y, y) is the covariance function, i.e., the kernel function, with the basic form as follows:
[0155]
[0156] where σ and l are hyperparameters of the kernel function;
[0157] The above Gaussian process is taken as the prior of the Gaussian process, denoted as f(y) ~ N(μ f , K ff );
[0158] The combination of the reduced near-infrared spectrum data and the label data (y * , z * ) is substituted into the Gaussian process prior, and z * and f(y) are subject to a joint Gaussian distribution, denoted as:
[0159]
[0160] where K ff = κ(y, y), K fy = κ(y, y * ), K zz = κ(y * , y * ), and then
[0161]
[0162] The above formula realizes Gaussian process regression and obtains the mean and covariance of the Gaussian process posterior distribution
[0163] After that, the hyperparameters σ and l of the Gaussian kernel function are determined by maximizing the probability of z appearing through the maximum likelihood estimation method, and the formula is:
[0164]
[0165] Finally, X pca is substituted into the Gaussian process posterior to obtain the predicted label data of the Gaussian process regression
[0166] 4. Establishment of two partial least squares regression models
[0167] According to the predicted label data obtained by the Gaussian process regression, a suitable threshold is selected to divide the original near-infrared data samples into two groups with similar sample numbers. One group has predicted label data lower than the threshold, and the other group has predicted label data higher than the threshold. Partial least squares regression models are established for the two groups of data, and the process is as follows.
[0168] After grouping, one of the near-infrared spectrum data matrices is X pt1 = [x1, x2, …, xp ] m×p Let Z represent a near-infrared data sample containing p m-dimensional data, with the label matrix Z = [z1, z2, ..., zn]. p ] n×p X and Y represent the powder properties data corresponding to the near-infrared spectral data sample. X and Y are standardized separately using the following formula:
[0169]
[0170] in, s x,j and They represent x respectively j Standard deviation and mean s z,j and They represent y respectively j The standard deviation and mean;
[0171] Next, calculate the first component t1 of E0 and the first component u1 of F0. To maximize the correlation between t1 and u1, the inner product θ1 must be maximized, as shown in the formula:
[0172]
[0173] Where w1 is composed of matrix The eigenvector corresponding to the largest eigenvalue is obtained. The first pair of components can be obtained from w1 and v1:
[0174]
[0175] The regression equations for E0 and F0 on t1 are:
[0176]
[0177] Where E1 and F1 are the residual matrices, and α1 and β1 are the regression coefficient vectors, the formula is:
[0178]
[0179] Replacing E0 and F0 with E1 and F1 respectively, and repeating the above steps, we can obtain the second pair of components t2=E1ω2 and u2=F1v2. Then the regression equations of E1 and F1 on t2 are:
[0180]
[0181] If the rank of E0 is r, then there exist r components t1, t2, ..., t r And the regression equation is:
[0182]
[0183] t k = w k1 x1+w k2 x2+…+w kp x p Substitute Y=t1β1+t2β2+…+t r β r (k=1, 2, …, r), the partial least squares regression equation of p labels can be obtained:
[0184]
[0185] The partial least squares regression equation is cross-validated and the first h components t1, t2, …, t h are intercepted, and the following definition is used:
[0186]
[0187] After extracting the components each time, the above formula is used for inspection, and when , the extraction of the components is stopped, and ε is the set accuracy requirement; in the above formula:
[0188]
[0189]
[0190] wherein, is the fitting value of the ith sample point.
[0191] In the embodiment, the partial least squares regression model is established for four powder characteristics respectively, so that the element in the label Y is 1-dimensional, that is, n=1.
[0192] After the above process, the models of the two groups of near-infrared spectrum data are established, and the prediction labels Y pre1 and Y pre2 of the two models are obtained respectively.
[0193] 5. Fusion of the two partial least squares regression models
[0194] In the present application, the Sigmoid function is used as the probability prediction function to fuse the results of the two partial least squares regression models, and the formula of the Sigmoid function is:
[0195]
[0196] In the formula, x=σ is the threshold point of the function, which is also the threshold value for dividing the results of the Gaussian process regression into two groups, and the corresponding output value is 0.5, and ω is the weight value of the function, and changing the weight value can make the function adapt to different label ranges.
[0197] The result of the Gaussian process regression is substituted into a Sigmoid function to obtain probabilities that the sample falls on two partial least squares regression models respectively, and the final prediction result is obtained by fusing the probabilities as weights, and the formula is:
[0198]
[0199] In the formula, is the predicted label data of the Gaussian process regression
[0200] 6, introduce evaluation index
[0201] In finding the best model, the cumulative degree of explanation of the PCA principal component, the PLSR model coefficient and the modeling result are comprehensively considered in the research, and when comparing the performance of the improved model and the ordinary partial least squares regression model, the corrected root mean square error is used as an evaluation index to evaluate the prediction ability of the model, and the formula is:
[0202]
[0203] In the formula, z i is the true label value, is the label value predicted by the regression model, and from the above formula, it can be seen that when the predicted value and the true value are closer, the RMSE is smaller, and the model effect is better.
[0204] After the model is constructed, the following steps are used to predict the farinograph characteristics of the wheat flour based on the model:
[0205] Step 1: Obtain the near-infrared spectrum data of the wheat flour and pre-process it, and sequentially perform standard normal transformation and multivariate scatter correction processing;
[0206] Step 2: Perform principal component analysis on the pre-processed near-infrared spectrum data of the wheat flour, and extract the first several principal components as the dimension-reduced spectrum data;
[0207] Step 3: Use the Gaussian process regression model to predict the dimension-reduced spectrum data to obtain the predicted label data of the Gaussian process regression;
[0208] Step 4: Input the predicted label data of the Gaussian process regression into two partial least squares regression models, and the two partial least squares regression models predict the predicted label data of the Gaussian process regression respectively to obtain prediction results Y pre1 and Y pre2 ;
[0209] Step 5: Substitute the results Y pre1 and Y pre2By substituting the sigmoid function, the probability of the sample falling on the two partial least squares regression models can be obtained, and the final prediction result is obtained by fusing the probability as the weight, and the formula is:
[0210]
[0211] In the formula, is the predicted label data of the Gaussian process regression
[0212] In order to verify the effect of the present application, a group of 968 experimental samples of wheat flour are selected as experimental objects to test the algorithm, and the experimental results are compared with the ordinary partial least squares regression method. The results show that the results of the ordinary partial least squares regression model of the four farinograph characteristics (water absorption, formation time, stability time and degree of weakening) of the wheat flour are 2.039, 1.837, 3.968 and 21.252, and the results of the improved model are 1.876, 1.160, 2.459 and 14.449.
[0213]
[0214] The experimental results show that the improved algorithm has smaller root mean square error, the model prediction result is closer to the true value, and it is more conducive to the detection application of near infrared spectroscopy technology.
[0215] In addition, the farinograph characteristic prediction method of the wheat flour in the embodiment adds the fuzzy classification of the Gaussian process regression after the preprocessing stage, establishes two partial least squares models respectively and fuses the results, optimizes the extraction and utilization of data characteristics, reduces the inefficient process of repeated optimization of similar methods, compared with the traditional and existing improved partial least squares method, the present application classifies the original data into two categories, so that the data with similar characteristics can be classified into one category and the partial least squares model is established respectively, then the results are fused, the data characteristics are fully utilized and the over-optimization operation in the preprocessing stage and the data input stage is avoided, not only the prediction accuracy can be effectively improved, but also the prediction efficiency is obviously improved, and the application scope of the present application is wider, and it is also applicable to different and more general other wheat flour spectrum data sets.
[0216] Part of the steps in the embodiment of the present application can be realized by software, and the corresponding software program can be stored in a readable storage medium, such as an optical disc or a hard disk.
[0217] The above only describes the preferred embodiments of the present application, and does not limit the present application, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method for predicting the properties of wheat flour, characterized in that, The method includes: Step 1: Obtain near-infrared spectral data of wheat flour and preprocess it; Step 2: Perform principal component analysis on the preprocessed wheat flour near-infrared spectral data, and extract the first few principal components as the dimensionality-reduced spectral data; Step 3: Use the Gaussian process regression model to predict the dimensionality-reduced spectral data to obtain the predicted label data of the Gaussian process regression. Step 4: Input the predicted label data of the Gaussian process regression into the improved partial least squares regression model to obtain the final wheat flour quality prediction results; The improved partial least squares regression model includes two partial least squares regression models, which respectively predict the predicted label data of the Gaussian process regression and respectively obtain the predicted result Y. pre1 and Y pre2 The final wheat flour properties prediction results are based on Y pre1 and Y pre2 The weighted fusion is obtained.
2. The method for predicting the flour properties of wheat flour according to claim 1, characterized in that, The improved partial least squares regression model is obtained based on the historical prediction label dataset of the Gaussian process regression model. The modeling process includes: Step 41: Select a grouping threshold for the historical predicted label dataset; Step 42: Based on the grouping threshold, divide the wheat flour near-infrared spectral data corresponding to the historical predicted label data into two groups with similar numbers. The predicted label data of one group is lower than the grouping threshold, and the predicted label data of the other group is greater than or equal to the grouping threshold. Step 43: Establish partial least squares regression models for the two sets of data respectively.
3. The method for predicting the flour properties of wheat flour according to claim 2, characterized in that, The method uses the Sigmoid function as the probability prediction function and fuses the prediction results of two partial least squares regression models. The formula for the Sigmoid function is: Where x = σ is the threshold point of the Sigmoid function, which is also the grouping threshold for dividing the historical predicted label data of Gaussian process regression into two groups. The corresponding output value of the grouping threshold is 0.
5. ω is the weight of the Sigmoid function. Changing the weight ω makes the function adapt to different label data ranges. Substituting the prediction results of Gaussian process regression into the Sigmoid function, we obtain the probabilities that the prediction results fall on the two partial least squares regression models respectively. Then, we fuse these probabilities as weights to obtain the final prediction result. The fusion formula is as follows: In the formula, This represents the prediction results of Gaussian process regression.
4. The method for predicting the flour properties of wheat flour according to claim 1, characterized in that, The preprocessing process in step 1 includes: Step 11: Perform standard normal transformation on each collected near-infrared spectral data of wheat flour, using the following formula: In the formula, x = [x1, x2, ..., x m [This refers to the original near-infrared spectral data of wheat flour.] n is the number of sampling points in the spectrum, i.e., the dimension, x k This is the value of the k-th sampling point of this spectrum; Step 22: Perform multivariate scattering correction on the spectrum after standard normal transformation. If there are n collected spectral data points, the dataset to be processed for multivariate scattering correction is: X snv =[x snv,1 ,x snv,2 ,…,x snv,n ] Where, x snv,1 ,x snv,2 ,…,x snv,n Spectral data processed by standard normal transformation; First, calculate the average value of all spectral data. As an ideal spectrum, the formula is: Secondly, a univariate linear regression was performed on the spectrum of each sample and the average spectrum, and the least squares problem was solved to obtain the baseline shift b for each sample. i and offset k i The formula is: Finally, the spectrum of each sample is corrected using the following formula: The spectral dataset after multivariate scattering correction is: X pt =[x snvmsc,1 ,x snvmsc,2 ,…,x snvmsc,n ].
5. The method for predicting the flour properties of wheat flour according to claim 1, characterized in that, The principal component analysis process in step 2 includes: Step 21: Use matrix X to process the preprocessed wheat flour near-infrared spectral data. pt ∈R n×m Let f(x) represent n samples with m-dimensional feature variables, in the following form: Where, x ij Let x represent the j-th dimension variable of the i-th sample. ij After standardization, we get: In the formula, S is the mean of the j-th dimension of all samples. j Its variance; Step 22: Set x ij Replace with Then X pt It has been transformed into The format is as follows: right covariance matrix Eigenvalue decomposition: In the formula, Λ is a diagonal matrix composed of the eigenvalues of R, Λ=diag[λ1,λ2,…,λ m U is the eigenvector matrix, and its columns u1, u2, ..., u3 are... m For feature vectors; Based on the eigenvalues λ of the correlation coefficient matrix R... j Calculate the cumulative explanatory power W j The formula is: In the formula, λ j These are the eigenvalues corresponding to the correlation coefficient matrix; Step 23: Combine the cumulative explanatory power W j Based on actual needs, choose X. pt Reduce the dimensionality and find the principal components in this new dimensionality for each sample. The dimensionality reduction formula is: In the formula, y i The component obtained by reducing the i-th near-infrared data to k dimensions; Principal component analysis revealed that the original matrix X represents the preprocessed near-infrared data matrix. pt Transformed into a lower-dimensional Y pca =[y1,y2,…,y n ].
6. The method for predicting the flour properties of wheat flour according to claim 1, characterized in that, The process of establishing the Gaussian process regression model includes: The spectral data X after dimensionality reduction by principal component analysis pca As input to Gaussian process regression, when f(Y)=[f(y1),f(y2),…,f(y... n If all y follows a multivariate Gaussian distribution, then f(y) is a Gaussian process, and its formula is: f(y)~N(μ(y),κ(y,y)) In the formula, μ(y) represents the mean of each dimension of the spectral data, and κ(y,y) is the covariance function, i.e., the kernel function, with the basic form as follows: In the formula, σ and l are hyperparameters of the kernel function; Taking the above Gaussian process as a priori, it is expressed as f(y) ~ N(μ). f ,K ff ); The combination of the dimensionality-reduced near-infrared spectral data and tag data (y * ,z * Substituting the Gaussian process prior, let z * f(y) follows a joint Gaussian distribution, expressed as: In the formula, K ff =κ(y,y), K fy =κ(y,y * ), K zz =κ(y * ,y * ), then we have The above equation implements Gaussian process regression and obtains the mean of the posterior distribution of the Gaussian process. Covariance Then, using the maximum likelihood estimation method, with the objective of maximizing the probability of z occurring, the hyperparameters σ and l of the Gaussian kernel function are determined, as shown in the formula: Finally, X pca Substituting the Gaussian process posterior, we obtain the predicted label data for the Gaussian process regression.
7. The method for predicting the flour properties of wheat flour according to claim 2, characterized in that, Step 43, which involves establishing a partial least squares regression model for the two sets of data, includes: After grouping, one of the near-infrared spectral data matrices is X. pt1 = [x1,x2,…,x p ] m×p Let Z represent a near-infrared data sample containing p m-dimensional data, with the label matrix Z = [z1, z2, ..., z]. p ] n×p X and Y represent the powder properties data corresponding to the near-infrared spectral data sample. X and Y are standardized using the following formula: in, s x,j and They represent x respectively j Standard deviation and mean s z,j and They represent y respectively j The standard deviation and mean; Next, calculate the first component t1 of E0 and the first component u1 of F0. To maximize the correlation between t1 and u1, the inner product θ1 must be maximized, as shown in the formula: Where w1 is composed of matrix The eigenvector corresponding to the largest eigenvalue is obtained. The first pair of components can be obtained from w1 and v1: The regression equations for E0 and F0 on t1 are: Where E1 and F1 are the residual matrices, and α1 and β1 are the regression coefficient vectors, the formula is: Replacing E0 and F0 with E1 and F1 respectively, and repeating the above steps, we can obtain the second pair of components t2=E1ω2 and u2=F1v2. Then the regression equations of E1 and F1 on t2 are: If the rank of E0 is r, then there exist r components t1, t2, ..., t r And the regression equation is: t k =w k1 x1+w k2 x2+…+w kp x p Substituting Y = t1β1 + t2β2 + ... + t r β r (k=1,2,…,r), thus obtaining the partial least squares regression equation with p labels: The partial least squares regression equation will perform cross-validation to truncate the first h components t1, t2, ..., t h The definition is as follows: The above formula is used to test each time a component is extracted. When the extraction of components stops, ε represents the set precision requirement; in the above formula: in, is the fitted value for the i-th sample point.
8. The method for predicting the flour properties of wheat flour according to claim 1, characterized in that, The method uses the corrected root mean square error (RMSE) as an evaluation metric to assess predictive ability, and the formula is: In the formula, z i The actual label value. This represents the final predicted label value.
9. The method for predicting the flour properties of wheat flour according to claim 1, characterized in that, The wheat flour properties include: water absorption rate, formation time, stability time, and degree of weakening.
Citation Information
Patent Citations
Vegetable oil identification method based on R language and orthogonal partial least square discriminant analysis
CN113392586A
Network intrusion detection method and system based on partial least squares
CN105516206A
Semi-supervised dimension reduction method and system based on partial least squares
CN109614986A