## 2 Materials and Methods
### Hyperplane Classification Method  
The method of hyperplane classification according to the above model of mimic manifestations of emotional state is intended to identify changes in a person's emotional state. The method is built according to the direction of visual analytics [43] and the \"human-in-the-loop\" principle [44], which distinguishes it from similar approaches by the transparency and interpretability of the decisions made according to it. That is, the method implements the principles of trust in decisions made with its help. The scheme of the method is shown in Figure 8.  
The input data of the method are a set of \(n\) points in the feature space (\(m\) number of features): \(x(i)\in\mathbb{R}^{m},\ i=\overline{1,n}\). In step 1 of the method, input data are visualized in two-dimensional space: \(\mathbb{R}^{m}\rightarrow\mathbb{R}^{2}\). The mapping \(\mathbb{R}^{m}\rightarrow\mathbb{R}^{2}\) is obtained by solving an optimization problem using evolutionary methods, similar to the problem of multidimensional scaling (MDS) [45]--determining the mutual location of points (vectors) in the space of smaller dimensions. The points are located so that the pairwise distances between them in the new space differ as little as possible from the empirically measured distances in the feature space of the studied objects. The Euclidean distance is used to calculate the distance. The similarity function uses the  
Figure 8: Scheme of the method of hyperplane classification of the emotional state by facial expressions: (**a**) training; (**b**) classification. Arrows here represent consistent transition from one method block to another. hypothesis that the smaller the distance between the objects, the more they are similar and vice versa. As a result, we obtain a set of points: \(x^{\prime}(i)\in\mathbb{R}^{2},\ i=\overline{1,n}\). In step 2, visual analytics is directly implemented in the \"human-in-the-loop\" direction, namely: (1) the separation ability of the training sample is visually evaluated in space \(R^{2}\) according to the proposed vector space model; (2) human-built lines (when possible) separating grouped clouds of points (classes), \(x^{\prime}(i)\in\mathbb{R}^{2},\ i=\overline{1,n}\); (3) the coordinates of the beginnings and ends of these lines are memorized; (4) if it is impossible to separate the obtained classes with a single line, piecewise continuous lines are formed (the end of one line is the beginning of another); and (5) for each line, in addition to the two start and end points, there are also \(m-2\) points located evenly between the start and end points. As a result, a set of new points is obtained: \(x^{\prime L}(i,j)\in\mathbb{R}^{2},\ i=\overline{1,l},\ j=\overline{1,m}\), where \(l\) is the number of lines, which is the result of visual analytics. In step 3, we carry out the inverse mapping \(\mathbb{R}^{2}\rightarrow\mathbb{R}^{m}\) (analogous to step 1) for the sets of points: \(x^{\prime}(i),\ x^{\prime L}(k,j)\in\mathbb{R}^{2},\ i=\overline{1,n},\ j= \overline{1,m},\ k=\overline{1,l}\), as a result of which we obtain (if possible) the set \(x^{L}(k,j)\in\mathbb{R}^{m},\ j=\overline{1,m},\ k=\overline{1,l}\). In step 4, we form systems of linear algebraic equations for the set of points \(x^{L}(k,j)\in\mathbb{R}^{m},\ j=\overline{1,m},\ k=\overline{1,l}\) located on the corresponding hyperplanes to determine the coefficients of these hyperplanes. There will be as many such systems as there are lines in \(R^{2}\). For the \(i\)-th hyperplane, the system of equations will have the form:  
\[\left\{ \begin{array}{l}w_{1}{x_{1}}^{L}(i,1)+w_{2}{x_{2}}^{L}(i,1)+\ldots+w _{m}{x_{m}}^{L}(i,1)+b=0;\\ w_{1}{x_{1}}^{L}(i,2)+w_{2}{x_{2}}^{L}(i,2)+\ldots+w_{m}{x_{m}}^{L}(i,2)+b=0;\\ \ldots\\ w_{1}{x_{1}}^{L}(i,m)+w_{2}{x_{2}}^{L}(i,m)+\ldots+w_{m}{x_{m}}^{L}(i,m)+b=0. \end{array} \right. \tag{8}\]  
Next, we define coefficients \(w_{i}\) and \(b\). Let us present (8) in the form of the equation of a hyperplane that passes through \(m\) points:  
\[\det