# Accurate Determination of Geographical Origin of Tea Based on Terahertz Spectroscopy
## 3 Classification Model
Two different parameter optimization methods were adopted to obtain the SVM model for the four different types of tea: Grid Search-SVM and the proposed GA-SVM. The accuracy of identification and miscalculated information on the samples are indicated in Tables 2 and 3. The identification rates of grid search-SVM and GA-SVM for the training set of the samples reached 100%. Before classifying the test set, we knew in advance which type of tea would be measured. When the Grid Search-SVM model was used to classify the test set, three samples of Zhuyeqing were wrongly identified as Maofeng and two samples of Maofeng were mistakenly identified as Zhuyeqing. When the GA-SVM model was utilized to classify the samples, two samples of Zhuyeqing were wrongly identified as Maofeng and one sample of Maofeng was mistaken for Zhuyeqing. In the GA-SVM model, the identification rate of the test set of the green tea samples reached 96.25%--higher than that of the Grid Search-SVM model (93.75%). The BP neural network is a nonlinear mapping from input to output [26]. It is a multi-layer feedforward network based on an error back propagation algorithm including input layer nodes, one or more layers of hidden nodes, and output layer nodes. Information is transmitted across nodes of different layers in a single direction, and the connection weights control the degree of connection; the weights are adjusted based on the training data. The information includes input from the input layer and outputs decisions to the output layer. We chose a three-layer BP neural network for tea classification. The design idea of a BP neural network in this paper is as follows: Firstly, we design a network with only one hidden layer node; In the process of training, a hidden layer node is added according to the rate of error descent and the  
Figure 8: (**a**) The isolines of GA-SVM; and (**b**) Grid Search-SVM parameter selection. variation of verification error, that is, when the rate of error descent is below the threshold and the validation error has reached the minimum value, a hidden layer node is added; When the minimum value of the validation error increases after the increase of the node, or the network training reaches the error target, the network training is stopped, so that we could obtain the minimum neuron network structure to ensure high enough network performance and generalization ability, and avoid as far as possible, the over-training problem. The network was trained with a scaled conjugate gradient algorithm with a tangent sigmoid function as the transfer function in the hidden layer. The network was trained with the trained function; the tansig function was selected as the hidden layer transfer function and purelin was used as the output layer. The training goal was set to 0 and the maximum number of training iterations was set to 1000. In fact, when the number of hidden layer nodes reached eight and the number of iterations reached 15, we obtained the training goal 0.00040572, which is closest to the training target goal, the network training was stopped, and the best training model was obtained (Figure 9). As shown in Table 4, when the BP neural network model was used to classify the test set, four samples of Zhuyeqing were wrongly identified as Maofeng and four samples of Maofeng were mistakenly identified as Zhuyeqing. In the BP neural network, the identification rate of the test set of the green tea samples reached 90%--lower than that of the Grid Search-SVM model (93.75%) and GA-SVM model (96.25%).