## 5 Performance Optimization of Distributed Face Recognition
### Dynamic Prediction Based on Extreme Learning Machine  
Extreme Learning Machine (ELM) is based on single hidden layer feedforward neural networks (SLFNs). ELM can randomly initialize input weights and offsets and obtain corresponding output weights, avoiding complicated manual tuning and attaining faster learning speed. It also has the advantages of parallel distributed processing, high fault tolerance and adaptive learning capability. In an n-L-m single hidden layer feedforward neural structure, given N samples \((\mathrm{x_{i}},\mathrm{t_{i}})\in\mathrm{R^{n}}\times\mathrm{R^{m}}\) in the training set, the input node \(\mathrm{x_{i}}=[\mathrm{x_{i1}},\mathrm{x_{i2}},\cdots,\mathrm{x_{in}}]^{ \mathrm{T}}\in\mathrm{R^{m}}\), the output node \(\mathrm{t_{i}}=[\mathrm{t_{i1}},\mathrm{t_{i2}},\cdots,\mathrm{t_{im}}]^{ \mathrm{T}}\in\mathrm{R^{m}}\), the single hidden layer neural network is as follows:  
\[\sum\
olimits_{\mathrm{j=1}}^{\mathrm{L}}\beta_{\mathrm{j}}\mathrm{f}\left( \mathrm{w_{j}}\cdot\mathrm{x_{i}}+\mathrm{b_{j}}\right)=\mathrm{y_{i}}( \mathrm{i}=1,2,\cdots,\mathrm{n}), \tag{10}\]  
where the input weight is \(\mathrm{w_{j}}=\left[\mathrm{w_{j1}},\mathrm{w_{j2}},\cdots,\mathrm{w_{jn}} \right]^{\mathrm{T}}\), \(\beta_{\mathrm{j}}\) represents the output weight, \(\mathrm{b_{j}}\) is the offset of the i-th hidden node, \(\mathrm{f(x)}\) is the activation function, \(\mathrm{w_{j}}\cdot\mathrm{x_{i}}\) is the inner product of \(\mathrm{w_{j}}\) and \(\mathrm{x_{i}}\). When the output error of the network is minimal, it can be expressed as \(\sum\
olimits_{\mathrm{j=1}}^{\mathrm{n}}\beta_{\mathrm{i}}\|\mathrm{y_{i}}- \mathrm{t_{i}}\|=0\). Therefore, it must have \(\beta_{\mathrm{j}}\), \(\mathrm{w_{j}}\) and \(\mathrm{b_{j}}\), which make the Equation (8) established. \[\sum\
olimits_{\mathrm{j=1}}^{\mathrm{n}}\beta_{\mathrm{j}}\mathrm{f}\left( \mathrm{w_{j}}\cdot\mathrm{x_{i}}+\mathrm{b_{j}}\right)=\mathrm{t_{i}}( \mathrm{i}=1,2,\cdots,\mathrm{n}). \tag{11}\]  
By representing Equation (8) by a matrix, we have  
\[\mathrm{H}\beta=\mathrm{T}. \tag{12}\]  
The expressions of \(\mathrm{H}\), \(\beta\), and \(\mathrm{T}\) are as follows:  
\[\mathrm{H}=\left[ \begin{array}{cccc}\mathrm{f}(\mathrm{w_{1}}\cdot\mathrm{x _{1}}+\mathrm{b_{1}})&\cdots&\mathrm{f}(\mathrm{w_{L}}\cdot\mathrm{x_{1}}+ \mathrm{b_{L}})\\ \cdots&\cdots&\cdots\\ \mathrm{f}(\mathrm{w_{1}}\cdot\mathrm{x_{n}}+\mathrm{b_{1}})&\cdots&\mathrm{ f}(\mathrm{w_{L}}\cdot\mathrm{x_{n}}+\mathrm{b_{L}})\end{array} \right] \tag{13}\]  
\[\beta=[\beta_{1}\beta_{2}\ \cdots\ \beta_{\mathrm{L}}]^{\mathrm{T}} \tag{14}\]  
\[\mathrm{T}=[\mathrm{t_{1}}\mathrm{t_{2}}\ \cdots\ \mathrm{t_{n}}]^{\mathrm{T}}. \tag{15}\]  
The training process of ELM is equivalent to solving \(\hat{\beta}\), which is the least-squares solution of Equation (9). \[\|\mathrm{H}\hat{\beta}\|-\mathrm{T}=\min_{\beta}\mathrm{H}\beta-\mathrm{T} \tag{16}\]This is equivalent to minimizing the loss function \(C\), which is given by  
\[C=\sum\
olimits_{i=1}^{n}\Bigl{(}\sum\
olimits_{j=1}^{L}\beta_{j}f\bigl{(}w_{j} \cdot x_{i}+b_{j}\bigr{)}-t_{i}\Bigr{)}^{2}. \tag{17}\]  
Then, the solution is \(\hat{\beta}=H^{\dagger}T\), where \(H^{\dagger}\) is the Moore-Penrose generalized inverse matrix of the hidden layer matrix \(H\). Since the number of pedestrians in a video processed by the agent changes dynamically, after processing the video into f frames, we use ELM to predict the number. Here, \(x_{i}\) is the frame number of the video, that is, the agent adds the number of the video frames into the input matrix while processing each video frame. The predicted results are expressed by \(y=[y_{1},y_{2},\cdots,y_{n}]^{T}(n=1,2,\cdots,L)\). The transfer function used in this paper is a sigmoid (.) function. \[f(x)=\frac{1}{1+e^{-x}} \tag{18}\]  
We also improve \(\hat{\beta}\) by adding a coefficient matrix \(A=E+H^{\dagger}H\), where \(E\) is an \(L\times L\) square matrix, and the elements in the square matrix are all 1.