# Mmpal _sciences_
## 2 Proposed Method
### Multi-Layer Feature Fusion PCANet
(3) The second layer convolution: Unlike the original PCANet, MPCANet concatenates the original input image with the output of the first convolution layer along the channel, and then it concatenates the result as the input of the second convolution layer; i.e., the input of the second convolution layer of MPCANet is \(I^{2}\). \[I^{2}=\left[I_{1}^{1},I_{2}^{1},\cdots,I_{N}^{1},I_{1,1}^{1},\cdots,I_{1,L_{1} }^{1},\cdots,I_{N,L_{1}}^{1},\cdots,I_{N,L_{1}}^{1}\right]\in R^{k_{1}k_{2} \times(L_{1}+1)Nmn} \tag{5}\]  
\(L_{2}\) is the number of filters in the second convolution layer [14]. \(I_{i}^{1}\) and \(I_{i,l}^{1}\) represent the output of the \(i\)-th original image and its first layer convolution, respectively. Enter \(I^{2}\) and repeat almost the same operation as the first layer to learn the filter kernel of the second layer, denoted as \(W_{j}^{2}=\left\{W_{1}^{2},W_{2}^{2},\cdots,W_{L_{2}}^{2}\right\}\). Therefore, for each \(I^{2}\) there are \(L_{2}\) outputs corresponding to:  
\[U_{i}^{l}=\left\{I_{i}^{2}*W_{j}^{2}\right\}_{j=1}^{L_{2}},i=1,2,\cdots,(L_{1} +1)N;l=1,2,\cdots,L_{1}+1 \tag{6}\]  
(4) Output layer: The output layer includes nonlinear processing, block histograms, and feature concatenation. After the second layer convolution, each original input image \(I_{i}^{1}\) has a \(L_{1}+1\) set of output maps, and each group contains \(L_{2}\) feature maps; i.e., a total of \((L_{1}+1)L_{2}\) feature maps are generated. For each set, the Heaviside step function \(H\) is used to binarize each output map, and then the binary hash code is used to convert each \(L_{2}\) output map into an output matrix \(D\) with an element value of \(0\sim 2^{L_{2}}-1\). \[D_{i}^{l}=\sum_{j=1}^{L_{2}}2^{j-1}H\Big{(}U_{i}^{l}\Big{)} \tag{7}\]  
A total of \(L_{1}+1\) output matrices \(D_{i}^{l}(l=1,2,\cdots,L_{1}+1)\) can be obtained. Finally, the block-based histogram [29,30] is used to obtain the feature of each image. \(D_{i}^{l}\) is divided into \(B\) blocks, and the histogram information of each block is counted. Then, the \(B\) histogram features are serially represented as \(Bhist\Big{(}D_{i}^{l}\Big{)}\). Finally, all \(Bhist\Big{(}D_{i}^{l}\Big{)}\) are connected into a matrix named the extended histogram feature vector, which is regarded as the feature representation \(F_{i}\) of input image \(I_{i}^{1}\). \[F_{i}=\left[Bhist\Big{(}D_{i}^{1}\Big{)},Bhist\Big{(}D_{i}^{2}\Big{)},\cdots, Bhist\Big{(}D_{i}^{L_{1}+1}\Big{)}\right]^{\text{T}},\ F_{i}\in R^{2^{L_{2}}(L_{1}+1)B} \tag{8}\]  
(5) Classification layer: the feature vector \(F_{i}\) obtained by the network output is used as the input of the random forest classifier, and the classifier is trained to obtain the classification results [14]. [PERSON] and [PERSON] [27] used two methods to prove that the random forest algorithm is effective for face data. In addition, although MPCANet is only a two-layer network model, it is as easy to extend to three or more layers as PCANet. Three-layer MPCANet (named MPCANet3) is also available. On the basis of retaining the first two layers of MPCANet structure, we cascade the output of the first layer and the second layer, and then we use the cascade results as the input of the third layer. Although we only extend to three layers, it can be extended to multiple layers in theory. A simple comparison of the processes for PCANet, MPCANet, and MPCANet3 is shown in Figure 1.