# Emotion Recognition by Correlating Facial Expressions and EEG Analysis
## 2 Materials and Methods
### Signal and Behavior Analysis  
EEG Analysis  
Our brain interprets emotional stimuli through a series of organicistic responses from the central nervous system [9]. Several studies use ML to analyze the behavior of emotional situations by recognizing patterns in the signals collected from the brain cortex--either region--or by considering all available information [20; 21]. However, one of the main challenges is that these patterns are sought in large time windows (the time the evoked potential lasts, which can range from a few seconds to minutes), which implies that many other events can affect the experimental process, such as eye movements, facial muscles or cognitive states unrelated to the experiment. The analysis through ML has been proven to diagnose medical and cognitive phenomena conditions successfully [5; 22; 23; 24; 25; 26; 27].  
Performing an adequate EEG signals analysis is one of the most critical stages for improving the recognition rate. The signal analysis stage is based on the considerations published in [21], which can be observed in Figure 3 and are described as follows:  
* Filtering. A bandpass filter was implemented, with a cutoff of 0.2 to 47 Hz, to exclude all those frequencies found outside of a brain rhythm, and the information obtained for each of the rhythm ranges was subdivided: delta (0.2 to 3.5 Hz), theta (3.5 to 7.5 Hz), alpha (7.5 to 13 Hz), beta (13 to 28 Hz) and gamma (>28 Hz).  
Figure 3: EEG analysis, treatment methodology, processing and feature extraction.  
* Electrode selection by Brodmann bounded regions. The electrode selection methodology proposed in [21] was implemented, where the Brodmann areas related to the areas of the cortex specialized in visual, auditory processing and the hypothalamus are linked. In this way, the analysis region is delimited only to those electrodes connected to the parietal, temporal, frontal and occipital lobes of the cortex since these could provide more information related to the emotional process. So we only consider the electrodes: F7, FC5, T7, CP5, P7, P3, O1, Pz, P4, P8, O2, CP6, T8, FC6 and F8. This process considerably reduces the amount of data to be processed, which helps to improve the processing time, specifically to 15 electrodes of a differentiated 10/20 scheme.
* Blind source separation (BSS) is used to eliminate all that information from the electrodes that were outside our boundary region by Equations (4) and (5). \[P_{Y}(y(n))=\prod_{i=1}^{m}P_{y}(y_{i}(n))\;\forall n,\] (4) \[S_{i}=e_{i}+\sum_{m=1}^{n}r_{m}.\] (5) Equation (4) is the probability distribution set and Equation (5) is the sum of the overlapped signals.
* Feature extraction. We use a wavelet Daubechies 4 transform to extract the translation and scale coefficients (Equation (6)), which will serve as features in the recognition process. Likewise, the variance between the scales is analyzed and added as an extra feature for the analysis. \[d_{j,k}=\left\langle f(t),\Psi_{j,k}(t)\right\rangle=\frac{1}{\sqrt{2}}\int f( t)\Psi(2^{-j}t-k)dt,\] (6) where \(\Psi_{j,k}(t)\) is the Mother wave for the four vanishing moments in Equation (7). \[\int_{\infty}^{\infty}t^{k}\Psi(t)=0\;\;for\;\;0\leqslant k<N.\] (7) The Daubechies wavelets are orthogonal and biorthogonal but they are not symmetrical. The compact support that is the range over which they are non-zero is \([0,2N-1]\) and these waveforms could be implemented in db2, 4, 8 and 16; however, there is not a rule that we can follow to select the vanishing level, and the four vanishing moments were made through experimentation. The literature reports that most of the experimental proposals are based on complex prepossessing techniques, such as wavelet or matching pursuits techniques, to process the signals [4,28], and some other proposals analyze the signals without a pre-processing stage by using exhaustive methods instead of traditional digital signal processing [29,30].