## 3 Materials and Methods
### The Construction of EEG MFI Sequences
The values of the gray points are calculated with the surrounding point values, and can be expressed as Equation (2):  
\[V_{(m,n)}=\frac{V_{(m+1,n)}^{\prime}+V_{(m-1,n)}^{\prime}+V_{(m,n+1)}^{\prime}+ V_{(m,n-1)}^{\prime}}{K},(0\leq m,\;n\leq 8,\;m,n\in N), \tag{2}\]  
where \(V\) is the value of the gray point (corresponding to \(P_{(m,n)}\)); and \(V^{\prime}\) is the value of the point surrounding \(P_{(m,n)}\). If the index of the surrounding point exceeds the range of 0 and 8, then the value  
Figure 2: The construction process diagram of the electroencephalographic (EEG) Multidimensional Feature Image (MFI) sequence. is 0. \(K\) is the number of non-zero elements in the numerator, and the default value of \(K\) is 1. After the feature matrix is filled, it is used as a base table to generate EEG MFI through the interpolation method. We generate the EEG MFI in MATLAB (R2016a, MathWorks, Boston, MA, USA, 2016). The code of the interpolation function and MFI generation method is presented in Appendix A. Using this code, the EEG MFI is constructed and saved as.png images with a size of 200 \(\times\) 200 pixels. An enlarged EEG MFI is shown in Figure 3. As seen in Figure 3, the frequency domain characteristics are mapped to a two-dimensional plane according to the spatial distribution of the EEG electrodes. This MFI corresponds to a five-second time window. It displays Subject 1's spatial PSD feature of the first-time window. The color legend explains the range of the normalized PSD and the variation. We can see from it that the higher the PSD value is, the closer it is to the dark red end. The lower the PSD value is, the closer it is to the dark blue end. The higher PSD value indicates that the EEG signal contains more energy and the corresponding brain area is more active. With this point, we can find in Figure 3 that the FP1 electrode is with the highest PSD value, and the lowest value appears at the FC\({}_{6}\) (FC\({}_{6}\) is a tested point in 10-20 system, you can find it in left image of Figure 1) electrode. In this study, in order to find out which time window size is more appropriate for emotion recognition, we build EEG MFI sequence with different length time windows. To illustrate the process of forming a MFI based on different time windows, we formalize the raw feature matrix into a four-dimensional matrix:  
\[\textbf{P}_{(electrode,sequence,trial,subject)}, \tag{3}\]  
where the size of the matrix is (32 \(\times\) 60 \(\times\) 40 \(\times\) 32). With the different time windows, it is possible to produce a different number of EEG MFIs. Assuming the number of EEG MFIs is N and the length of the time window is t, N equals sequence/t. The pseudo-code of producing the specific feature matrix is expressed in Appendix B. Figure 4 displays the first five MFIs of Subject 1 with different time windows. Each row represents the MFIs with the same time window, and each line represents the MFIs with the same sequence order. Taking the first and the second row in Figure 4 as example, we can see that the first row represents the EEG variation over five seconds with five frames; however, the second row represents the same time variation with two frames. MFI\({}_{(1,5)}\) and MFI\({}_{(2,3)}\) are very similar. Accordingly, we can infer that the MFI sequence with a short time window provides more details about the variation than the MFI sequence with a long-time window. The meaning of the color in Figure 4 is the same as it in Figure 3.  
Figure 1:0 An enlarged EEG MFI with the names of the electrodes and contour lines.