# EEG Data Augmentation for Emotion Recognition with a Task-Driven GAN
## 3 The Proposed Method
### EEG Data Augmentation for Emotion Recognition
#### 3.2.2 The Task-Driven CWGAN
\begin{table}
\begin{tabular}{c c c c c} \hline Subjects & Videos & EEG Channels & Sampling Rate & Emotional Dimensions & Label Values \\ \hline
32 & 40 & 32 & 128 Hz & Arousal and Valence & Continuous values in the range of 1–9 \\ \hline \multicolumn{5}{c}{Data format of each subject (Array shape)} \\ \hline \multicolumn{5}{c}{Videos \(\times\) EEG Channels \(\times\) Sampling rate \(\times\) Segment length = 40 \(\times\) 32 \(\times\) 128 Hz \(\times\) 63 s (3 s in rest and 60 s watching videos)} \\ \hline \end{tabular}
\end{table} 
Table 2: A summary of the pre-processed version of DEAP; the first three seconds (of each segment) is the resting state of the subject before watching the videos. #### 4.1.3 Experiment Details

The setting and adjustment of network parameters, experimental process, and other experimental details will be shown in this section. According to previous relevant studies, the hyperparameter \(\lambda\) in Formula (5) was set to 0.1. The grid search was introduced to qualify the hyperparameter \(\rho\) in Formula (4) with the measure of minimizing the W-distance between the original dataset and the artificial dataset; finally, 0.1 was chosen as the value of \(\rho\). Then, the generative adversarial training was repeated five times to obtain the mean W-distance/MMD. Regarding the evaluation, a five-fold cross-validation was performed to obtain the mean accuracy of the classification task. ### Result

#### 4.2.1 Quality of Generated Data

First, the distribution difference between the original dataset and the artificial dataset, which was generated by the proposed method and the original CWGAN, respectively, was evaluated via two common indicators used to measure the similarity of data distribution, i.e., W-distance and MMD. The abscissa in Figure 4 presents two emotional dimensions, i.e., arousal and valence. The ordinate represents the mean W-distance/MMD value from multiple experiments. The blue and orange bars correspond to the proposed method and the original CWGAN, respectively. The smaller the W-distance or MMD value, the closer it is to the original data distribution. Figure 4 shows that the proposed method improved the distribution similarity compared with the original CWGAN in both emotional dimensions. Figure 4: W-distance and MMD between the generated data and the original data under the proposed method and the original CWGAN. Figure 3: Mapping the one-dimensional DE feature vector into a feature matrix according to the spatial distribution of 32 EEG channels. Next, UMAP was used to conduct visualization with dimension reduction to observe the distribution of generated data. It can be seen from Figure 5 that the original CWGAN (b) and the proposed method (c) both generate data of corresponding classifications in the original dataset (a); however, the former generates a wide range of banded data, while the latter generates a smaller range of flaky regions besides the original dataset. This is because the classifier introduced a regularization term related to the classification of the generator loss, which limited the generated data to a closer range with the original data of the corresponding classification, indicating that the proposed method makes the generated sample classifications clearer. The three figures on the first line show the EEG DE feature on the emotional dimension (arousal), while the figures on the second line pertain to valence. #### 4.2.2 Improvement of Performance of Emotion Recognition Task

Finally, we evaluated the improvement in the performance of emotion recognition, mainly focusing on the improvement of classification task accuracy on the testing set by data augmentation using the original CWGAN and the proposed method. Table 3 shows the mean accuracy of emotion recognition in five-fold cross-validation without data augmentation, with data augmentation through the original CWGAN, and with data augmentation through the proposed method, respectively.