# Human-Computer Interaction Multi-Task Modeling Based on Implicit Intent EEG Decoding
## 3 Methods
### Feature Extraction  
The basic principle of the CSP algorithm is to fuse the multi-channel signal to obtain the optimal spatial filter, maximize the variance of different categories of signals after projection,  
Figure 1: Multi-task experimental stimulation methods and the algorithmic model framework of this paper. Figure 2: Interactive intention task extraction procedure: (**a**) field research; (**b**) functional and content analysis; (**c**) experimental prototyping. and finally obtain the features with the maximum discrimination in the spatial domain. The traditional CSP algorithm is used to find two types of signals with mixed space filters, which is not suitable for multi-classification feature extraction, so some improvements are needed. The improved algorithm is as follows:  
1. Calculate the mixed space mean covariance matrix  
Firstly, calculate the covariance matrix of the multi-channel EEG signal of each intention type: \(X_{i}\)\((N\times T)\) is a multi-channel evoked response time-spatial signal matrix under two types of intent tasks, where \(N\) is the number of channels and \(T\) is the time point data collected for each channel. After normalizing the data, the covariance matrix of the two types of intentions was calculated for each segment \(R_{i}\):  
\[R_{i}\ =\ \frac{X_{i}X_{i}^{T}}{\text{trace}(X_{i}X_{i}^{T})},i\ =\ 1,2,3,4,5 \tag{1}\]  
\(X^{T}\) represents the transpose of the matrix \(X\), and trace \(\left(XX^{T}\right)\) means the sum of elements on the diagonal of the matrix. Then, by averaging the segments, we obtain the average covariance matrix of intentions \(\overline{R_{i}}\). The sum of the covariance matrix of every two types out of five intents is the covariance matrix of the mixed space covariance matrix \(R\). Thus, for the five-class problem, we obtain a total of 10 mixed spaces. For the mixed space composed of the first and second type of intentions, the mean covariance \(R\):  
\[R\ =\ \overline{R}_{1}+\overline{R}_{2} \tag{2}\]  
2. Construct hybrid spatial filters with pairwise intention pairs  
First, calculate the whitening feature matrix. Eigenvalue decomposition is used for \(R\):  
\[R\ =\ U\lambda U^{T} \tag{3}\]  
where \(U\) is the eigenvector matrix; \(\lambda\) is the diagonal array of the corresponding eigenvalues, arranged in descending order of the eigenvalues. Arrange the eigenvalues in descending order, and convert the whitening feature matrix \(P\):  
\[P\ =\ \sqrt{\lambda^{-1}}U^{T} \tag{4}\]  
Then, the whitened matrix is used to act on mean covariance, including:  
\[S_{i}\ =\ P\overline{R_{i}}P^{T},i\in 1,2,3,4,5 \tag{5}\]  
where, in the direction of \(S_{1}\) maximum eigenvalue, take the minimum eigenvalue of \(S_{2}\), and \(B\) is found by the following calculation:  
Each type of intention EEG signal corresponds to four spatial filters, which are filtered, respectively. Since there are ten mixed spaces above, each of the five types of intention EEG needs to be projected onto four spatial filters, respectively. The filtering process is calculated as follows:  
Firstly, suppose \(W_{1}\) is a mixed intention spatial filter composed of the first type and second type of intentions \(X_{1}\)\(X_{2}\). \(X_{1}\)\(X_{2}\) are projected through the spatial filter \(W_{1}\), and we obtain two types of intention features \(Z\):  
\[ \begin{array}{rcl}Z_{1}&=&W_{1}\times X_{1}\\ Z_{2}&=&W_{1}\times X_{2}\end{array}  \tag{10}\]  
Then select the first \(n\) rows and last \(n\) rows vectors as features to decompose, which best represent the two intent types; take the variance as an example; and the final features are obtained after the following changes:  
\[f_{i}\ =\ \lg\frac{\text{var}(Z_{i})}{\sum\limits_{k\ =\ 1}^{2n}\text{var}(Z_{k})} \tag{11}\]  
4. Integrate intent features by column
5. After different spatial filters are applied to the original intention EEG data, the intention features are obtained and then spliced into columns.