# Research on the Simulation Method of HTTP Traffic Based on GAN
## 5 Evaluation
### Implementation Details  
The detailed explanation of the generator and discriminator architectures used in this paper is provided in Chapter 4. In the actual implementation process, the parameters \(\lambda\) for the learning rates of the generator \(F_{D}\) and \(F_{M}\) were set to 0.5. This setting ensured a balance between maintaining image quality and preserving the diversity of generated images, thus achieving a compromise between the two objectives.  
Regarding the number of generator populations, we chose to train three populations. After each training session, the same discriminator was used for fitness evaluation. The optimizer parameters for each generator population were consistent, with a learning rate of \(1\times 10^{-5}\). The training process for each generator population consisted of 5000 epochs.  
The output dimension of the AE module, which corresponded to the noise input of the generator, was set to 50 based on multiple experiments. The batch size during training was set to 64. Using a batch size that is too large can lead to a decrease in the quality of generated data, while a batch size that is too small can result in slower training speed. Therefore, 64 was chosen as a compromise considering both factors. The specific implementation details of the generator and discriminator are described in detail in Tables 2 and 3, respectively.  
In the experiments, we explored various network architecture parameters and found that overly complex basic blocks (stacking multiple layers of Swin Transformer) did not significantly improve the quality of generated data for the generator. Instead, they increased the computational burden of the model and prolonged the computation time. After multiple trials, we determined that a generator model consisting of three layers of TransformerEncoder struck a balance between image quality and speed.  
For the discriminator, a 4-layer convolutional network structure was sufficient to discriminate between real and fake data in the context of network traffic data. During the construction of the discriminator model, we chose the LeakyReLU activation function instead of the commonly used Tanh or Softmax functions. Under the guidance of these two activation functions, LeakyReLU helped to avoid the problem of gradient vanishing that may occur with the other two activation functions. This ensured that the generator  
\begin{table}
\begin{tabular}{l l l l l l l} \hline \hline
**Layer Number** & **Neural Network Type** & **Input Resolution** & **Channels** & **Depth** & **Headers** & **Window Size** \\ \hline
1 & TransformerEncoder & [1, 1] & 64 & 4 & 4 & 4 \\
2 & PatchExpand & [1, 1] & 64 & - & - & - \\
3 & TransformerEncoder & [2, 2] & 32 & 4 & 4 & 4 \\
4 & PatchExpand & [2, 2] & 32 & - & - & - \\
5 & TransformerEncoder & [4, 4] & 16 & 4 & 4 & 4 \\
6 & PatchExpand & [4, 4] & 16 & - & - & - \\
7 & TransformerEncoder & [8, 8] & 8 & 4 & 4 & 4 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Generator architecture.  
\begin{table}
\begin{tabular}{l l} \hline \hline
**Layer Num** & **Network Architecture** \\ \hline
1 & Conv2d(1, 64, kernel\_size = (4, 4), stride = (2, 2), padding = (1, 1), bias = False) \\
2 & BatchNorm2d(64, eps = \(1\times 10^{-5}\), momentum = 0.1) \\
3 & LeakyReLU(negative\_slope = 0.2, inplace = True) \\
4 & Conv2d(64, 128, kernel\_size = (4,4), stride = (2, 2), padding = (1, 1), bias = False) \\
5 & BatchNorm2d(128, eps = \(1\times 10^{-5}\), momentum = 0.1) \\
6 & LeakyReLU(negative\_slope = 0.2, inplace = True) \\
7 & Conv2d(128, 256, kernel\_size = (4,4), stride = (2,2), padding = (1,1), bias = False) \\
8 & BatchNorm2d(256, eps = \(1\times 10^{-5}\), momentum = 0.1) \\
9 & LeakyReLU(negative\_slope = 0.2, inplace = True) \\
10 & Conv2d(256, 1, kernel\_size = (2, 2), stride = (1, 1)) \\
11 & Sigmoid() \\ \hline \hline \end{tabular}
\end{table}
Table 3: Discriminator Architecture.  
consistently learned gradient information from the discriminator, making LeakyReLU more suitable for generating network traffic data.