# A VPN-Encrypted Traffic Identification Method Based on Ensemble Learning
## 2 Methodology
### Optimization of FL-XGB-VPN-Encrypted Traffic Identification Model
\[X_{t+1}=arg\;max\mu_{t}(x)+\sqrt{\beta}\sigma_{l}(x) \tag{17}\]  
In Equation (17), \(\sqrt{\beta}\) denotes the constant used to determine the equilibrium exploration and exploitation, and \(f_{t+1}\) is the objective function value. The framework of the VPN-encrypted traffic identification model based on Bayesian optimization is shown in Figure 5.  
The algorithm improvement steps for optimizing the FL-XGB model using the Bayesian approach are as follows:  
1. Initialize the FL-XGB model, and choose the FL-XGB model as the training target. The objective function \(f\) is the average evaluation value of the identification model. The set of input parameters \(P\) and the range of parameter values and the objective function \(f\). Randomly set 6 parameters to be optimized, and determine the number of iterations of the algorithm \(n=6\);
2. Update the mean \(\mu_{t}(x)\) and variance \(\sigma_{t}(x)\) of the prior \(p(f|D)\) based on the current training data \(D\), and calculate the value of the acquisition function based on the mean and variance of \(p(f|D)\);3. Determination of the next parameter taking point \(X_{n+1}=arg\;max\mu_{t}(x)+\sqrt{\beta}\sigma_{t}(x)\) according to the extreme value of the acquisition function;
4. Calculate the model evaluation value \(f_{n}\) using the new parameter values in the FL-XGB model;
5. Find the optimal parameter value by the model evaluation value in step (4);
6. Determine whether the number of iterations reaches n;
7. When the maximum number of set iterations is reached, the parameter optimization process stops. Output a combination of parameter values with the highest evaluation value;
8. Otherwise, continue with step 2 Bayesian optimization parameters until the termination condition is met;
9. The optimal combination of parameters obtained in step (7) is input into the FL-XGB model to obtain the optimal identification model. The final identification result of the output model, i.e., the evaluation value. The final identification result of the model, i.e., the evaluation value \(f_{n+1}\), is output. In this paper, seven variables of the model are optimized based on the Bayesian optimization algorithm. The probabilistic agent model is selected as a Gaussian process model, and the acquisition function is constructed through a strategy based on the probability of lifting and the amount of lifting. Then, find the optimal value of the objective function of the combined parameters. The objective function is combined with a Bayesian global parameter search strategy to continuously add sample points to update the posterior distribution of the objective function. The global optimal parameter combination is input into the FL-XGB model for training. We found that the FL-XGB-VPN-encrypted traffic identification model optimized by the Bayesian optimization method can directly improve the identification rate of the model by optimizing the parameters. At the same time, the method has the advantages of fewer iterations and faster speed. Figure 5: Optimization algorithm framework for encrypted traffic identification model.