# Deep Representation of EEG Signals Using Spatio-Spectral Feature Images
## 3 Methods
### Spatio-Spectral Feature Image Definition and Generation  
An SSFI is a set of images representing EEG data in the spatial and spectral domains. Each image in an SSFI corresponds to a spatio-spectral representation for a single band of frequencies. In EEG studies, there are well-established frequency bands associated with particular mental and emotional states of the brain. Accordingly, in this study, we considered the main EEG frequency bands. Raw 14-channel EEG segments are transformed into SSFI 3D arrays that represent the spatio-spectral distribution of power. The shape of the SSFI 3D array is \(D_{1}\times D_{2}\times D_{3}\), where \(D_{1}\times D_{2}\) is the size of a 2D grid representing the scalp topography and \(D_{3}\) is the number of frequency bands. Preserving the scalp topography is important in multi-channel EEG studies, as spatially close scalp sites are in general affected by common brain sources.  
Given a multi-channel EEG segment and a set of \(D_{3}\) frequency bands of interest, an SSFI array is generated as follows. Rectangular grids are used to represent the spatial density of power within one frequency band and are constructed using spherical-to-polar coordinate conversion, so that the scalp locations corresponding to the recording electrodes are associated to one of the grid locations. Based on the power spectral density of each EEG channel, the power in each frequency band is computed and assigned to the electrode's entry in the corresponding rectangular grid. The spatial density of power on the \(D_{1}\times D_{2}\) grid is then obtained by interpolating and extrapolating the values computed from each electrode, by using a bicubic method adapted from the MNE library [37]. Figure 2 shows the spatial density of power for a single frequency band on a scalp topography and its corresponding rectangular grid. By stacking the \(D_{3}\) spatial densities of power, we obtain the final SSFI array of dimensions \(D_{1}\times D_{2}\times D_{3}\).  
Prior to the generation of SSFI arrays, the 14-channel EEG signals were pre-processed as follows. First, each EEG channel was filtered with a fifth-order, highpass IIR filter with cascaded second-order sections and with cut-off frequency of 0.5 Hz. Then, artifacts were removed using the ATAR (automatic and tunable artifact removal) algorithm described in [38], with parameter \(\beta=0.1\). After this pre-processing stage, one-second long (128 samples) segments were extracted, allowing 0.75 s (96 samples) overlap (shift 0.25 s, 32 samples) between consecutive segments.  
The power spectral density of each segment channel was obtained using the Welch method with a Hamming window. Based on the estimated power spectral density, the power within the following six frequency bands was computed: 0.1-4 Hz (delta, \(\delta\)), 4-8 Hz (theta, \(\theta\)), 8-14 Hz (alpha, \(\alpha\)), 14-30 Hz (beta, \(\beta\)), 30-47 Hz (low gamma, \(\gamma_{1}\)), and 47-64 Hz  
Figure 2: Spatial power distribution for a single frequency band on a topographic map and its corresponding SSFI on a rectangular grid. The spatial power distribution is obtained from a 14-channel EEG segment whose recording electrodes are identified on the topography.  
(high gamma, \(\gamma_{2}\)). This process resulted in a feature vector \(F\) of 84 (\(6\times 14\)) dimensions, \(F\in\mathbb{R}^{84}\), per EEG segment:  
\[F=\begin{bmatrix}F_{\delta}\\ F_{\theta}\\ F_{\alpha}\\ F_{\beta}\\ F_{\gamma_{1}}\\ F_{\gamma_{2}}\end{bmatrix} \tag{1}\]  
where \(F_{i}\in\mathbb{R}^{14}\) is the power of the 14 channels of an EEG segment within each band \(i\in\{\delta,\theta,\alpha,\beta,\gamma_{1},\gamma_{2}\}\). A \(64\times 64\) rectangular grid was chosen for the scalp topography, resulting in a \(64\times 64\times 6\) SSFI array. Figure 1 illustrates the process of extracting a sequence of SSFI arrays from consecutive 14-channel EEG segments from the PhyAAt dataset.