# Emotion Analysis AI Model for Sensing Architecture Using EEG
## 3 Emotion Analysis AI Model Using EEG  
### Selection and Use of Dataset for Fine-Tuning Training  
This study selected the SEED dataset (BCMI Laboratory, Shanghai Jiao Tong University, Shanghai, China) as the AI dataset for training the brainwave-based fine-tuned model. The SEED dataset was created in 2013, and is provided by the BCMI Research Institute at Shanghai Jiao Tong University. It includes brainwaves (EEG) and pupil movement data. The dataset consists of data collected while participants watched emotion-inducing video clips. Specifically, video clips were selected to induce positive, negative, and neutral emotions. The EEG and pupil movement data of 12 participants and the additional EEG data of three participants were included. A total of 15 participants' data were included, and a training dataset with 644,000 rows was created. The SEED dataset is an EEG (brainwave) dataset designed to study emotion recognition, and it consists of data collected via 14 video clips that induce various emotional states. The dataset was classified based on the number of video clips according to emotion (happy, sad, neutral), the length of each video clip, and the number of collected data rows. First, there are four videos that induce sadness, and the total playback time of these videos is 927 s. The EEG data for these videos were sampled at 200 Hz, and a total of 185,400 rows of data were generated. The videos that induce sadness play an important role in analysing the subjects' emotional responses and studying the brainwave patterns caused by sadness. Then, there are five videos that induce happiness, and the total length of these videos is 1186 s. A total of 237,200 rows of EEG data were generated in the happy state, and they were used to analyse various positive emotions and study the brainwave features of happy emotions. Finally, there are five videos that induce neutral emotions, and their total length is 1107 s. A total of 221,400 rows of EEG data were collected from these neutral videos, which allow the brain's activity during neutral emotional states to be understood. Overall, the 14 video clips in the SEED dataset include 3200 s of playback time and 644,000 rows of EEG data. This data structure provides the various emotional states that are required in emotion recognition research, and allows researchers to analyse the minute changes in brainwaves caused by emotional states. This dataset was used to fine-tune the brainwave emotion model in this study (Table 1). The SEED dataset was selected because its system of applying labels to each video, as shown in Table 2, is suitable for constructing an AI model. In addition, it has been used by more than 2600 application programs and more than 770 research organisations as of October 2021, and one of the papers that uses the dataset, [PERSON] (2015) [16], has been cited more than 910 times [14]. The present study used the labelled data for three emotions (happy, sad, and neutral) from the SEED dataset. Examples of the video clips include 'Lost in Thailand', 'World Heritage in China', 'Aftershock', and 'Back to 1942', and each clip is labelled 0, 1, or 2, which indicate sad, neutral, or happy emotions, respectively. Such labelling helps analyse and understand the differences in the brainwave patterns according to the emotional state. However, because the total length and number of rows differ for each emotional category (sad, neutral, happy), we balanced the data by extracting an equal number of \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Emotion** & **Video Clip** & \
\begin{tabular}{c} **Video Length** \\ **(s)** \\ \end{tabular} &
\begin{tabular}{c} **Number of Data Rows** \\ **(200 Hz)** \\ \end{tabular} \\ \hline Sadness & 4 & 927 & 185,400 \\ Happiness & 5 & 1186 & 237,200 \\ Neutral & 5 & 1107 & 221,400 \\ Total & 14 & 3220 & 644,00 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Training volume using SEED dataset.