# WorkloadGPT: A Large Language Model Approach to Real-Time Detection of Pilot Workload
## 4 Data
### Data Augmentation
#### 4.5.1 Using GAN for Feature Augmentation  
The generative adversarial network (GAN) algorithm consists of two parts: the generator and the discriminator:  
1. **Generator design** The goal of the generator is to produce high-quality synthetic features that approximate the true data distribution. The input to the generator typically consists of high-dimensional random noise vectors. To enhance the quality and diversity of these seeds, this study incorporates random noise from a standard normal distribution, the SMOTE algorithm [57], and the Mixup technique [72] to generate these seeds:  
1. Random noise from a standard normal distribution: Initial seeds are generated through high-dimensional random noise vectors, utilizing the standard normal distribution \(N(0,1)\) to introduce randomness. This enhances the diversity of the seeds but may also lead to instability in seed quality. \[z\sim N(0,1)\]  
Figure 6: Workflow of the GAN-Ensemble data augmentation method. SMOTE algorithm: SMOTE generates more realistic samples by interpolating between neighboring real samples within the same category. This method improves the quality of the seeds but limits their diversity. \[x_{new}=x_{i}+\lambda\left(x_{i}^{(k)}-x_{i}\right)\] where \(\lambda\)-Uniform (0,1). 3. Mixup technique: According to the study [72], Mixup creates new synthetic samples by performing linear interpolation in both feature and label spaces between two randomly selected samples. Applying this method to the generation of seeds for the generator not only enhances the diversity of the seeds but also maintains a certain level of quality. \[x_{new}=\lambda(x_{i})+(1-\lambda)x_{j},y_{new}=\lambda(y_{i})+(1-\lambda)y_{j}\] where \(\lambda\)-Beta(\(\alpha\),\(\alpha\)). Unlike standard GANs that rely on a single method for generating synthetic data, our GAN-Ensemble combines random noise, SMOTE, and Mixup to generate seeds for the GAN. This hybrid approach ensures that the generator receives high-quality and diverse inputs, enabling it to learn a more accurate data distribution. This is particularly beneficial during the initial training phase when the generator is still learning, and it is crucial for both the stability of the training process and the quality of the generated data. The training of the generator includes the use of reconstruction loss for supervised learning. This loss function aims to minimize the Euclidean distance between the generated samples and the original samples. The expression for the loss function is as follows:  
\[L_{rec}(X,Z)=\sum_{z\in Z,x\in X}\left\|z-x\right\|^{2}\]  
where \(X=\{x\}\) represents the normalized original experimental sample set [73] and \(Z=\{z\}\) denotes the synthetic sample set generated by the generator. (2) **Discriminator design**  
The task of the discriminator is to distinguish between generated and real samples. This is a binary classification task, where the discriminator performs its judgment function by calculating the probability that a sample belongs to the real data set. The loss functions used are binary cross entropy (BCE) and Wasserstein distance with gradient penalty (WGAN-GP) [59], as follows:  
\[L_{D}\big{(}\overline{X}\big{)}=L_{BEC}(\overline{X})+L_{WGAN-GP}\big{(} \overline{X}\big{)}\]  
where, \(L_{D}(\overline{X})\) represents the discrimination loss, \(L_{BEC}(\overline{X})\) is the BCE loss, and \(L_{WGAN-GP}(\overline{X})\) is the Wasserstein distance with gradient penalty. The expressions for \(L_{BEC}(\overline{X})\) and \(L_{WGAN-GP}(\overline{X})\) are as follows:  
\[L_{BEC}(\overline{X})=\sum_{x\in X}-[1_{x\in X}\log D(x)+1_{x\in X}\log(1-D(x))]\]  
\[L_{WGAN-GP}(\overline{X})=E_{x\sim Z}[D(G(x))]-E_{x\sim X}[D(x)]+\lambda E_{ \tilde{x}\sim P_{x\sim X}}[(|\
abla_{\tilde{x}}D(\tilde{x})|^{2}-1)^{2}]\]  
where, \(D(x)\) represents the probability that sample \(x\) belongs to the original data. \(1_{x\in X}\) equals 1 when the sample comes from the original data, and \(1_{x\in X}\) equals 1 when the sample is synthesized by the generator.