# Emotion Analysis AI Model for Sensing Architecture Using EEG
## 3 Emotion Analysis AI Model Using EEG
### Fine-Tuned Model Development and Training  
#### 3.3.1 Data Pre-Processing  
As the initial stage in the training of the fine-tuned model, data pre-processing is essential. Data pre-processing plays an important role in maintaining the quality and consistency of the brainwave data; in particular, it removes noise above 60 Hz and improves  
Figure 2: Emotion classification when entering brainwave parameters on the web.  
the signal-to-noise ratio. This helps the model learn brainwave signals more accurately. In addition, by using a method that removes commonly occurring artefacts (e.g., eye blinking, muscle movement) from the brainwave data, it can maintain the data's integrity and minimise unnecessary signal modification. This data pre-processing procedure focuses on reducing errors caused by loss or human manipulation that can occur during the secondary processing of the data. This approach can more accurately ascertain users' emotional states in architectural spaces by proving high reliability and precision during model training.  
The 60 Hz line noise filter in EnoBio EEG's NIC2 program (Neuroelectrics, Barcelona, Spain, v2.1.3.6) was applied to remove noise from the brainwave data and ensure the consistency of the data. Subsequently, no additional calibration was performed, to increase the universality of the fine-tuned model and minimise the modification of the fine-tuning training data of the GPT model. Instead, considering that GPT is an LLM model, the data were patterned through a structuring process that arranges the data in a vector space instead of extracting features from the brainwave data with a numerical index. The features are extracted using this method to minimise the researchers' interference with the data (Figure 3).  
This pre-processing and structuring process allows the brainwave data to be used more efficiently and helps the model learn the complex patterns of brainwave signals more accurately.  
In the fine-tuning process, the SEED dataset was used as training data to perform training and evaluate the performance of the model. However, the hyperparameter configuration used during fine-tuning (e.g., batch size, learning rate, cross-validation settings) is constrained by the fine-tuning framework of the current GPT model. Accordingly, this study followed OpenAI's guidelines by maintaining the basic settings while training the model. In the future, if permission to alter the hyperparameters is granted, it will be necessary to perform additional studies to optimise those settings and further improve the performance of the model.  
OpenAI's guidelines focus on the basic training-parameter settings to maintain the stability of the model and prevent overfitting. As hyperparameters, such as batch size and learning rate, can have a significant influence on the learning speed and accuracy of the model, they are currently constrained to pre-defined values. Owing to these constraints, researchers perform training according to the initial model settings, and they can evaluate the potential performance of models based on the results obtained in this way. Future hyperparameter optimisation studies will play an important role in improving the performance of the models.  
Figure 3: Rules for dataset utilising 8-channel EEG Data.