# 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
* Calculate the classifier loss: 3: Place the real sample into the classifier to obtain the classification loss of the fake sample. 4: Place the fake sample generated by the generator into the classifier to obtain the classification loss of the fake sample. Training generator (update the parameters of the generator): 5: The random noise is placed into the generating network to generate a fake sample. 6: The discriminator judges the fake sample to obtain the true-or-fake loss. 7: The classifier classifies the fake sample to obtain the classification loss. Figure 2: The framework of the network based on CWGAN in the proposed method. ## 4 Experimental Works and Results

### Experiment Works

#### 4.1.1 Database

The DEAP dataset [20] is a multimodal dataset collected by [PERSON] and others from Queen Mary University in London, as well as other institutions, to study human emotional states. It contains EEG and peripheral physiological signals from 32 participants who viewed 40 music video segments (1 min per segment). The signal was sampled on 48 channels at a frequency of 512 Hz (the first 32 were EEG channels). Moreover, each video was directly scored on a nine-point scale from four dimensions: valence, arousal, dominance, and liking. A pre-processed version of the dataset was provided by the creators for the convenience of users, in which the EEG signals were downsampled to 128 Hz and the EOG was removed. Table 2 presents a pre-processed version of DEAP. In this study, the experiment was conducted on two emotional dimensions (valence and arousal) of the multi-channel EEG data in the pre-processed version of DEAP. #### 4.1.2 Data Processing

The raw EEG signal was subdivided into five different frequency bands in DEAP, on the basis of the intra-band correlation of EEG signals in different human behavioral states. The degree of perception increased with the frequency band, i.e., the high-frequency band was more reflective of the emotional state. At the same time, existing research shows that differential entropy features perform well in EEG emotion recognition [12; 13; 14], so we calculated the differential entropy features of four types of high-frequency data reserved in the pre-processed version of DEAP: \(\theta\), \(\alpha\), \(\beta\) and \(\gamma\). Differential entropy (DE) is a generalization of Shannon information entropy on continuous variables. Its expression is shown in Formula (6):

\[DE=-\int_{a}^{b}p(x)\log(p(x))dx \tag{6}\]

where \(p(x)\) is the probability density function of the continuous random variable \(x\). The differential entropy of a certain length of an EEG signal obeying the Gauss distribution \(N\big{(}\mu,\sigma_{i}^{2}\big{)}\) is defined in Formula (7):

\[ \begin{array}{ll}DE&=-\int_{a}^{b}\frac{1}{\sqrt{2\pi\sigma_{i}^{2}}}\exp \biggl{(}-\frac{(x-\mu)^{2}}{2\sigma_{i}^{2}}\biggr{)}\log\biggl{(}\frac{1}{ \sqrt{2\pi\sigma_{i}^{2}}}\exp\biggl{(}-\frac{(x-\mu)^{2}}{2\sigma_{i}^{2}} \biggr{)}\biggr{)}dx\\ &=-\frac{1}{2}\log(2\pi e\sigma_{i}^{2})\end{array}  \tag{7}\]

The specific band of each sample can be represented by a one-dimensional DE feature vector (length: 32). We used the method in [27] to map the one-dimensional vector into a feature matrix according to the spatial distribution of 32 EEG channels on the EEG electrode map (Figure 3); each non-zero value in the matrix represents the DE value of the corresponding electrode (channel) position. Finally, the feature matrices corresponding to the four frequency bands were stacked to form a 4 \(\times\) 9 \(\times\) 9 feature cube. In addition, we divided the emotional scores into high and low categories by five. In this experiment, we conducted the training and testing on two emotional dimensions, i.e., valence and arousal, respectively.