Near infrared spectroscopy detection of the content of wheat based on improved deep belief network

In order to solve the complicated problem of traditional detection of the content of Wheat, a method for predicting the content of wheat components by near infrared spectroscopy based on improved deep belief network is proposed. In this paper, wavelet transform is used to preprocess near infrared spectroscopy of wheat, and then a quantitative analysis model of wheat’s moisture, protein and ash content is established by using deep belief network. And combined with the random hidden algorithm, the network model is sparse processed, and the sparse network is obtained. So as to improve the accuracy and stability of the network. The experimental results show that using the improved deep of belief network to establish the quantitative analysis model on the content of wheat, and the correlation coefficient of moisture, protein and ash content were 0.9978, 0.9928, 0.9920, standard error of prediction were 0.0069, 0.0628,0.0535. Compared with the traditional deep belief network (DBN) and the traditional shallow learning BP neural network algorithm, the prediction results have been significantly improved.


Introduction
Wheat is one of the main sources of people's daily food. Wheat is one of the important sources of protein in people's diet. Protein is the nutrients that the body must take every day. Too much or too little intake can affect the body. Therefore, the quality and safety of wheat is directly related to the health of consumers. However, in recent years, adding excessive whitening agent and lime in wheat flour with the purpose of weight gain was repeatedly exposed, which not only has a huge negative impact on society, but also harm the health of consumers and food safety seriously. With the rapid, accurate, non-destructive testing technology is adopted to detect the content of wheat in line with modern high quality of life needs. Near infrared spectroscopy nondestructive testing technology has the advantages of fast, high efficiency, no pollution and no need of sample pretreatment. At present, it has been widely used in food quality analysis [1], fruit quality analysis [2] and many other fields. The establishment of an analytical model for moisture, protein and ash in wheat has a certain practical significance for wheat quality testing.
At present, the new methods are emerging, and the popular methods are mainly shallow learning methods such as PLS [3], neural network [4] and Support Vector Machine [5] (SVM). A common feature of these networks is that they all use the structure of no more than three layers to transform the original input signal into a feature space. There is no doubt that shallow learning is very effective to solve simple problems, in solving complex practical applications, there are many problems such as insufficient expression of function. However, in the same number of nodes, the deep learning network is usually more expressive than the shallow network. In this paper, a method based on improved DBN (deep belief network) is proposed for the determination of wheat component content by near infrared spectroscopy. Wavelet transform can remove the spectral information with the noise in the data and realize effective compression of hyperspectral data and reduce the amount of computation model. The pretreated data and the corresponding analytical data were used as input to the network model, and the content of wheat components was used as the network output. A wheat network model for predicting the component content of wheat was established.

Deep Belief Network
Deep belief network model is composed of a plurality of restricted Boltzmann machine (RBM) and a layer of BP neural network [6]. First, unsupervised training, the first RBM to get the initial weight, and then the training of the output as the next RBM input, layer by layer training, until the training of all the RBM.

Gauss Restricted Boltzmann Machine
In this paper, the Gauss restricted Boltzmann machine is used instead of the restricted Boltzmann machine. And then the Gauss restricted Boltzmann machine model is obtained. The energy model is as follows.
In the upper form, c is bias at the input layer node, b is bias of hidden layer nodes, W is the connection weight between the input layer node and the hidden layer node, σ is the standard deviation of the input spectral data. All parameters are real numbers.The corresponding conditional probability distributions of the visible and hidden layers are as follows.
, 2 , In the upper form,

The Training of Deep Belief Networks
The training of deep belief network consists of two stages. The training process is as follows: (a)Unsupervised pre training: physicochemical corresponding near infrared spectra of cotton polyester blended data and Analysis on its value as the input of Gauss restricted Boltzmann machine of each layer is trained using unsupervised learning method, and the output of each Gauss restricted Boltzmann machine as the next Gauss restricted Boltzmann machine input. Layer training Gauss restricted Boltzmann machine, until the end of the top.
(b)Supervised fine tuning: the parameters obtained by pre training are used as initial values of the network, and the whole network is trained with a supervised BP network to tune parameters.

Random Hidden Algorithm
The random hidden algorithm is an implicit model fusion algorithm, which can effectively prevent the overfitting of the model by changing the network structure. In the course of training and training, the random concealment algorithm changes the probability parameters of the network layer, which causes the network to hide some hidden layer nodes randomly until the end of training.
In this paper, the random hidden algorithm is implemented by changing the network structure. The nodes in the dashed line indicate that they are not involved in training and testing, and the weight is zero, similar to the hidden layer noise reduction method. The random hidden algorithm will change the probability parameters of the network layer, which will cause the network to randomly discard some hidden neurons. When the model is trained, the weights of certain hidden layers are changed randomly, so that the weights of all nodes in the hidden layer are 'fused'.

Experimental Data
In this paper, the spectra of wheat samples were obtained by using SupNIR-1520 near infrared spectrometer(Focused Photonics Inc), and the spectral area is 1000~2500nm. The collected spectral data were processed by MATLAB2015a software. A total of 400 wheat samples were collected, and their moisture, protein and ash contents were determined by quantitative chemical analysis. The near infrared spectroscopy of wheat are shown in Figure 1.

Preprocessing of the Original Spectrum
The original spectrum contains irrelevant information, a lot of redundant information in the spectrum will increase the complexity of the model, and even affect the prediction accuracy. In order to reduce the influence of various interference factors on the performance of the correction model, it is necessary to preprocess the original spectral data. The wavelet transform is used to process the original spectral data. Wavelet transform can separate noise and real spectral signals, and highlight spectral information, and compress the spectral data. The method entails using db3 wavelet at 3 levels decomposition to process original spectral data. The compressed near-infrared spectrum data matrix is obtained, and the compressed spectral data points are reduced to 13% of the original data, the energy retention rate is 99%. The spectrum after the wavelet transform is shown in Figure 2.

Partition of Sample Set
The establishment of quantitative analysis of near infrared spectra requires the selection of reasonable and representative sample sets. The training set sample data limits the applicable range and prediction accuracy of the model. Therefore, this paper used SPXY algorithm according to the ratio of 3:1 to divide 400 samples. The method can guarantee the uniform distribution of the spatial distance of the sample spectral data, and make the samples evenly distributed in the training set and the prediction set, so as to ensure the rationality and representativeness of the sample set. The training set is used to establish the analytical model, and the prediction set is used to test the reliability and stability of the model. The training set has 300 samples, and the prediction set has 100 samples.

Determination of Network Model
The random hidden algorithm changes the structure of the network model by hiding the hidden layer nodes, thus improving the stability and prediction accuracy of the network. Set the probability of random concealment, the initial value is 0.05, and then increase to 1 by 0.05 for the step size, then train under the probability parameters, and compare the prediction results. The experimental results show that the network model with stable and higher prediction accuracy can be obtained when the random concealment parameter is set to 0.6.

Results of Experiment and Discussions
300 training set samples and 100 prediction set samples of wheat near infrared spectrum data were collected as input data of improved DBN. The improved DBN method for the determination of the content of wheat components is as follows.
(a) Inputing the spectral data of training set to the RBM in the underlying layer. The learning rate of the connection weight between the hidden layer and the visual layer, the learning rate of the visual layer and the hidden layer bias are initialized to 0.1.
(b) The output of the bottom RBM is used as the input of the DBN, and the weights and offsets of the previous RBM are kept unchanged. Using the state of the hidden layer neuron to train the next RBM, and then output the result of the parameter vector.
(c) The connection weights of hidden layer nodes are obtained by pre training to initialize corresponding nodes. And the probability ratio of random hidden algorithm is 0.6, the learning rate is 0.1. The network is trained by the function of neural network, and the hidden layer nodes are discarded randomly.
(d) Using stochastic gradient descent method to update the weights, and train them many times until convergence.
(e) The parameters that are iterated by random concealment algorithm are used as the optimal values, and the predicted data is input into the trained network for prediction. The experiment was repeated several times and analyzed and compared with the simulation results. The experimental results were obtained.
In accordance with the improved DBN model established in this paper, the NIR spectra of wheat were predicted. The results are compared with the traditional deep belief network model and the traditional shallow learning BP neural network, the results are shown in table 1. As can be seen from table 1. Compared with the traditional DBN prediction method and the traditional shallow learning BP neural network, the improved DBN based prediction method proposed in this paper has significantly improved the prediction results.
The wheat near infrared spectroscopy model using the improved DBN based analysis, the correlation coefficient of moisture, protein, ash content prediction can reach more than 0.99, the moisture, protein and ash content of the forecast result and the real value of fitting curve is shown in figure3, figure4 and figure5.

Conclusion
The research work shows that it is feasible to use the near infrared spectroscopy and the improved DBN algorithm to detect the content of wheat components. Moreover, this method is also applicable to the detection of other agricultural products. An improved DBN network model is seen as a deep learning model. Firstly, the wavelet transform method is used to preprocess the original spectra of Wheat. Then, DBN is combined with random hidden algorithm, and the sparse structure of the network model is realized by changing the structure of the network, and the sparse network is obtained. Finally, using the improved DBN method to model and predict on the content of wheat, the correlation coefficient of prediction of the corresponding moisture, protein and ash content were 0.9978, 0.9928 and 0.9920, the predicted standard deviation were 0.0069,0.0628 and 0.0535. The experimental results prove that the model has good stability and accuracy, and enrich the modeling algorithm of near infrared spectroscopy technology, and lay the foundation for the transmission and sharing of the model.

Acknowledgment
This work is supported by National major scientific instruments and equipment development projects (2014YQ470377).The authors awfully thanks for anonymous reviewers who made constructive comments.