# Predicting Architectural Space Preferences Using EEG-Based Emotion Analysis: A CNN-LSTM Approach
## 4 Data Analysis and Model Development  
### EEG Data Preprocessing  
To improve signal quality and ensure accurate analysis, we conducted a multistep preprocessing procedure on the EEG data [148,149]. This included (1) filtering and artifact removal, (2) channel selection and re-referencing, and (3) final dataset construction, as shown in Figure 7.  
The initial dataset comprised 4000 EEG trials collected from 40 participants, with each participant evaluating 100 architectural images. EEG signals were recorded at a sampling rate of 500 Hz using the 10-20 electrode system, with a focus on the parietal (Pz, P3, and P4) and occipital (Oz, O1, and O2) regions. Each trial included a 1-s baseline (\(-\)200 ms to 0 ms) followed by a 5-s stimulus response window (0-5 s). Firstly, we applied a 1-30 Hz bandpass filter to preserve frequency bands particularly relevant to emotional and cognitive processing (notably, alpha [8-12 Hz] and beta [12-30 Hz]), while removing low- and high-frequency noise [150,151]. A finite impulse response filter (order = 2048, Hamming window) was first applied to band pass the EEG signals within the 1-30 Hz range. This was aimed at preserving the frequency bands most relevant to emotional and cognitive processing--namely, the alpha (8-12 Hz) and beta (12-30 Hz) bands--while attenuating low- and high-frequency noise. To eliminate power line interference, a fourth-order Butterworth notch filter was applied at 60 Hz. Figure 6: The experimental procedure and trial structure. Figure 7: The electroencephalography (EEG) data preprocessing process. Next, we conducted an independent component analysis to identify and remove physiological artifacts such as eye blinks, muscle movements, and cardiac signals. Next, the 'pop_runica' function in the EEGLAB toolbox was used to apply the extended infomax algorithm ('extended', 1), with default EEGLAB parameters including a maximum iteration count of 512 and an initial learning rate of 0.001 [116; 152]. Following the independent component analysis decomposition, the ICLabel plugin was used to automatically classify each independent component into categories such as 'brain', 'eye', and'muscle'. Components with a probability of 0.9 or higher in the 'eye' or'muscle' categories were marked for removal. This criterion was implemented using the 'pop_icflag' function, with the threshold set as [NaN NaN; 0.9 1; 0.9 1; NaN NaN; \(\ldots\)], ensuring the preservation of neural signals while selectively removing artifact-related components. In our analysis, we focused on parietal (Pz, P3, and P4) and occipital (e.g., Oz and O2) channels. Parietal channels are closely linked to spatial cognition, attention, and emotion processing--particularly useful for examining P300--while occipital channels are central to visual information processing [26; 153; 154; 155]. We then applied a common average reference across channels to reduce variance and enhance dataset consistency [156; 157; 158]. This yielded an improved interpretability in ERP analyses [158; 159; 160]. We performed common average referencing by subtracting the average signal across all channels from each individual channel. This method reduces the common-mode noise shared among electrodes and mitigates reference bias between channels [161; 162]. Specifically, common average referencing suppresses unnecessary global fluctuations (e.g., non-neural noise uniformly distributed across electrodes), thereby enhancing the relative differences between channels and improving the interpretability of ERP and other signal analyses. EEG data are originally recorded with an initial reference electrode (typically represented as a zero-filled channel). By including this initial reference channel in the averaging process and subsequently removing it after re-referencing, the full-rank status of the data can be preserved.