# 2D Gaze Estimation Based on Pupil-Glint Vector Using an Artificial Neural Network
## 2 Proposed Methods for Gaze Estimation
\begin{array}{cccccccc}N&\sum\limits_{i=1}^{N}x_{ ei}&\sum\limits_{i=1}^{N}y_{ei}&\sum\limits_{i=1}^{N}x_{ei}y_{ei}&\sum\limits_{i=1}^{N}x_{ ei}^{2}&\sum\limits_{i=1}^{N}y_{ei}^{2}\\ \sum\limits_{i=1}^{N}x_{ei}&\sum\limits_{i=1}^{N}x_{ei}^{2}&\sum\limits_{i=1} ^{N}x_{ei}y_{ei}&\sum\limits_{i=1}^{N}x_{ei}^{2}y_{ei}&\sum\limits_{i=1}^{N}x _{ei}^{3}y_{ei}&\sum\limits_{i=1}^{N}x_{ei}y_{ei}^{2}\\ \sum\limits_{i=1}^{N}y_{ei}&\sum\limits_{i=1}^{N}x_{ei}y_{ei}&\sum\limits_{i=1 }^{N}y_{ei}^{2}&\sum\limits_{i=1}^{N}x_{ei}y_{ei}^{2}&\sum\limits_{i=1}^{N}x _{ei}^{2}y_{ei}&\sum\limits_{i=1}^{N}y_{ei}^{3}\\ \sum\limits_{i=1}^{N}x_{ci}y_{ei}&\sum\limits_{i=1}^{N}x_{ei}^{2}y_{ei}&\sum \limits_{i=1}^{N}x_{ei}y_{ei}^{2}&\sum\limits_{i=1}^{N}x_{ei}^{2}y_{ei}^{2}& \sum\limits_{i=1}^{N}x_{ei}^{3}y_{ei}&\sum\limits_{i=1}^{N}x_{ei}y_{ei}^{3}\\ \sum\limits_{i=1}^{N}x_{ei}^{2}&\sum\limits_{i=1}^{N}x_{ei}^{3}&\sum\limits_{ i=1}^{N}x_{ei}^{2}y_{ei}&\sum\limits_{i=1}^{N}x_{ei}^{3}y_{ei}&\sum\limits_{i=1}^{N}x _{ei}^{4}&\sum\limits_{i=1}^{N}x_{ei}^{2}y_{ei}^{2}\\ \sum\limits_{i=1}^{N}y_{ei}^{2}&\sum\limits_{i=1}^{N}x_{ei}y_{ei}^{2}&\sum \limits_{i=1}^{N}y_{ei}^{3}&\sum\limits_{i=1}^{N}x_{ei}y_{ei}^{3}&\sum\limits_ {i=1}^{N}x_{ei}^{2}y_{ei}^{2}&\sum\limits_{i=1}^{N}y_{ei}^{4}\\ \end{array} \right] \tag{4}\]  
As with \(a_{j}\), the value of \(b_{j}\left(j=1,2,3,4,5,6\right)\) can be calculated. In fact, the relationship between the number of coefficients in mapping function (\(r\)) and polynomial order (s) is as follows:  
\[r=1+\sum\
olimits_{i=1}^{s}\left(t+1\right). \tag{5}\]  
According to Equation (5), when an \(s\) order polynomial is utilized to solve the gaze mapping function, at least \(r\) gaze calibration markers are required. For a head-mounted (intrusive) gaze tracking system, the relative position of the monitor screen and the user's head and eyes remains nearly fixed. In this case, the higher-order terms in the mapping function are mainly utilized to compensate for error between the estimated and actual gaze direction. The higher the polynomial order, the higher the calculation accuracy. However, the number of polynomial coefficients to be solved will increase at the same time (Equation (5)). In addition, the number of calibration markers required also increases. This not only makes the calibration time longer; the cumbersome calibration process also adds to the user's burden. Users are prone to be fatigued, thus affecting the calibration accuracy. In order to further enhance the mapping accuracy and realize precise estimation of gaze direction, a novel artificial neural network (DLSR-ANN) based on direct least squares regression is proposed to solve a mapping function between pupil-glint vectors and calibration markers. We rewrite the matrix equation in Equation (4) as:  
\[\mathbf{Q}\mathbf{a}=\mathbf{p}, \tag{6}\]  
where \(\mathbf{a}=\left[ \begin{array}{cccccccc}a_{1}&a_{2}&a_{3}&a_{4}&a_{5}&a_{6} \end{array} \right]^{\text{T}}\), \(\mathbf{p}=\left[\sum\
olimits_{i=1}^{N}x_{ci}&\sum\
olimits_{i=1}^{N}x_{ci}x_{ ei}&\sum\
olimits_{i=1}^{N}x_{ci}y_{ei}&\sum\
olimits_{i=1}^{N}x_{ci}x_{ei}y_{ei}\\ \sum\
olimits_{i=1}^{N}x_{ci}x_{ei}^{2}&\sum\
olimits_{i=1}^{N}x_{ci}y_{ei}^{2 }\right]^{\text{T}}\), \(\mathbf{Q}\) is the coefficient matrix. Figure 2 shows the scheme framework of an improved artificial neural network based on direct least squares regression. The DLSR-ANN is a three-layer neural network with input layer, hidden layer, and output layer. Elements of matrix \(\mathbf{p}\) including pupil-glint vectors gazing at calibration markers are determined as the input of a neural network. Elements of matrix \(\mathbf{a}\) are determined as the output of a neural network. The input, output, and hidden layers contain one, one, and three nodes, respectively. As shown in Figure 2, coefficient matrix elements of direct least squares regression are employed as connection coefficients in the input and hidden layers of DLSR-ANN.