# 2D Gaze Estimation Based on Pupil-Glint Vector Using an Artificial Neural Network
## 2 Proposed Methods for Gaze Estimation
According to the respective characteristics of input, hidden, and output layers and the relationship among them, appropriate weighting functions \(g_{1}\left(t\right)\), \(g_{2}\left(t\right)\), \(g_{3}\left(t\right)\) are determined. Derivatives of \(g_{1}\left(t\right)\), \(g_{2}\left(t\right)\), and \(g_{3}\left(t\right)\), respectively, are calculated (\(f_{1}\left(t\right)\), \(f_{2}\left(t\right)\), \(f_{3}\left(t\right)\left(f\left(t\right)=\mathrm{d}g\left(t\right)/\mathrm{d }t\right)\)) as the transfer function of the neuron. The selection of specific parameters is described in Section 3.4. As a three-layer neural network, its output layer carries an integrator. The integrator's initial condition \(\mathbf{a}\left(0\right)=\mathbf{a}_{0}=\left[ \begin{array}{cccc}a_{1}\left(0\right)& a_{2}\left(0\right)&a_{3}\left(0\right)&a_{4}\left(0\right)&a_{5}\left(0\right)&a_{6} \left(0\right)\end{array} \right]^{\mathrm{T}}\) is calculated through a linear polynomial solution utilizing direct least squares regression. In the proposed method, to solve the mapping function in Equation (6), the steepest gradient descent method [74] is adopted as the training method of the neural network. To determine the relationship between hidden layer and output layer, the error cost function and continuous-time learning rule of DLSR-ANN are defined according to the constraint condition of solving direct least squares regression. According to the error distribution characteristics of gaze estimation, the Euclid norm (\(L_{2}\) norm) is selected to acquire the minimal error cost function, which is in the same form as the error solving criterion of direct least squares regression, as defined in Equation (7):  
\[\xi\left(\mathrm{a}\right)=\frac{1}{2}\|\ \mathbf{e}\ \|^{2}=\frac{1}{2}\mathbf{e}^{ \mathrm{T}}\mathbf{e}, \tag{7}\]  
where \(\mathbf{e}=\mathbf{Q}\mathbf{a}-\mathbf{p}\) is the solution error of Equation (6) in direct least squares regression. Equation (7) can be further expressed as follows:  
\[\xi\left(a\right)=\frac{1}{2}\left(\mathbf{Q}\mathbf{a}-\mathbf{p}\right)^{ \mathrm{T}}\left(\mathbf{Q}\mathbf{a}-\mathbf{p}\right) \tag{8}\] \[=\frac{1}{2}\left(\mathbf{a}^{\mathrm{T}}\mathbf{Q}^{\mathrm{T}}\mathbf{Q}- \mathbf{a}^{\mathrm{T}}\mathbf{Q}\mathbf{p}-\mathbf{p}^{\mathrm{T}}\mathbf{Q}\mathbf{a}+\mathbf{p}^{\mathrm{ T}}\mathbf{p}\right).\]  
According to an error cost function based on the constraint condition of direct least squares regression, the learning rule of a continuous-time neural network is set as Equation (9). The function of the learning rule is to modify the weights of DLSR-ANN adaptively to acquire the optimal solution. \[\frac{da}{dt}=-\mu\
abla_{a}\xi\left(a\right)=-\mu\frac{\partial\xi\left( \mathrm{a}\right)}{\partial\mathrm{a}}, \tag{9}\]  
where \(\mu\) is the learning rate parameter. As a positive-definite matrix, \(\mu\left(\mu=\left[\mu_{vw}\right],v,w=1,2,\cdots,n\right)\) is generally selected as a diagonal matrix. In general, \(\mu\) is determined by experience. If \(\mu\) is set too  
Figure 2: Scheme framework of improved artificial neural network based on direct least squares regression. small, the weights of the neural network will be modified by the learning rule slowly. More iterations will be needed to reach the error bottom. If \(\mu\) is set too large, the learning rule will show numerical instability. To ensure the stability of the differential equation in Equation (9) and the convergence of its solution, a small enough \(\mu\) is chosen according to Equation (10):  
\[0<\mu<\frac{2}{\lambda_{max}}, \tag{10}\]  
where \(\lambda_{max}\) is the maximal eigenvalue of auto-correlation matrix composed by input vector \(\mathbf{p}\) in direct least squares regression. When the eigenvalue is unavailable, the auto-correlation matrix can replace it.