# A Fusion Framework for Confusion Analysis in Learning Based on EEG Signals
## 3 Methods
### Preprocessing  
Since the majority of EEG signals are concentrated within the range of 1 Hz to 50 Hz, a bandpass filter with a range of 1 Hz to 50 Hz was selected. This filtering procedure serves a dual purpose, eliminating low-frequency baseline drift, electrocardiographic (ECG) interference, and other high-frequency noise while effectively removing the most prominent power line interference (typically 50 Hz in China). Furthermore, EEG signals overlap with the electrooculogram (EOG) and electromyogram (EMG) signals in the frequency band. Therefore, relying solely on a single bandpass filter is insufficient to eliminate interference from EOG and EMG. This study adopted the fast, independent component analysis (fast ICA) to eliminate artifacts from EOG and EMG.  
EEG comprises multiple time series corresponding to different spatial positions on the cerebral cortex where different electrodes are located on the collection device. Like audio signals, frequency-domain features are the most salient features. Thus, the spectrogram of the signals is typically employed for analysis. In frequency-domain analysis methods, Power Spectral Density (PSD) analysis is a typically adopted method, and most previous  
Figure 1: Overview of the proposed framework.  
studies have used this method to investigate epilepsy and hypnosis [31; 32]. This method extracts frequency features that effectively detect cognitive and motor tasks [33]. Moreover, the PSD method consistently exhibits the highest robustness and effectiveness in extracting distinctive spectral patterns to differentiate motor imagery EEG signals accurately [34].  
In this paper, [PERSON]'s method is used to extract the power spectrum features of EEG signals. The data sequence is applied to data windowing, producing modified periodograms [35]. For the EEG signal \(x(n)\) of a certain channel, first divide it into \(L\) segments, with each segment having \(M\) sampling points, then the \(i\)-th small segment \(x_{i}(n)\) can be denoted as:  
\[x_{i}(n)=x(m+iM),0\leqslant m<M,0\leqslant i<L \tag{1}\]  
take \(iD\) to be the point of start of the \(i\) th sequence. Then, \(L\) of length \(2M\) represents data segments that are formed. The resulting output periodograms give:  
\[\overset{\approx(i)}{P}_{xx}(f)=\frac{1}{MU}\left|\sum_{n=0}^{M-1}x_{i}(n)w(n) e^{-j2\pi/n}\right|^{2} \tag{2}\]  
Here, in the window function, \(U\) gives the normalization factor of the power and is chosen such that:  
\[U=\frac{1}{M}\sum_{n=0}^{M-1}w^{2}(n) \tag{3}\]  
where \(w(n)\) is the window function. The average of these modified periodograms gives [PERSON]'s power spectrum as follows:  
\[P_{xx}^{W}=\frac{1}{L}\sum_{i=0}^{L-1}\overset{\approx(i)}{P}_{xx}(f) \tag{4}\]  
EEG signals predominantly reside within the 1 Hz to 50 Hz range, categorized into five frequency bands, depicted in Table 1. In this paper, the above method is applied to extract the PSD features of all channels and five frequency bands of EEG signals. Instead of manually selecting several of the five frequency bands for PSD feature extraction, the key features are extracted with the powerful ability of the transformer deep-learning network architecture. We divided each sample into 0.25 s slices. The sum of values within the five frequency bands is computed for each time slice and used as a separate measurement for each channel. This approach ensures that the extracted features encompass both frequency-domain and temporal information. PSD features for each time slice are extracted separately. This results in a sample with dimensions of \([W,B\times C]\), where \(W\) is the number of time slices, \(B\) is the number of frequency bands, and C is the number of channels. Figure 1 illustrates the above process.