## 5 Road Friction Estimation
### Structure of ANN Classifier and Weight Tuning Algorithm  
The total signals in the forward pass can be calculated as the following equations  
\[\mathbf{a}_{1}=f_{1}(\mathbf{W}_{1}\mathbf{x}+\mathbf{b}_{1})\in\Re^{n\times 1} \tag{17}\]  
\[\mathbf{a}_{2}=f_{2}(\mathbf{W}_{2}\mathbf{a}_{1}+\mathbf{b}_{2})\in\Re^{n \times 1} \tag{18}\]  
\[\mathbf{a}_{3}=f_{3}(\mathbf{W}_{3}\mathbf{a}_{2}+\mathbf{b}_{3})\in\Re^{n \times 1} \tag{19}\]  
\[\hat{\mathbf{n}}=f_{4}(\mathbf{W}_{4}\mathbf{a}_{3}+\mathbf{b}_{4})\in\Re \tag{20}\]  
where \(\mathbf{x}\in\Re^{4\times 1}\) is the input of the proposed ANN classifier. In addition, \(\mathbf{W_{1}}\in\Re^{n\times 4}\), \(\mathbf{W_{2}}\in\Re^{n\times n}\), \(\mathbf{W_{3}}\in\Re^{m\times n}\), and \(\mathbf{W_{4}}\in\Re^{1\times m}\) (\(n=25\), \(m=5\)) are the weight matrixes (or vectors) of the first hidden layer, the second hidden layer, the third hidden layer, and the output layer, respectively. \(\mathbf{b_{1}}\in\Re^{n\times 1}\), \(\mathbf{b_{2}}\in\Re^{n\times 1}\), \(\mathbf{b_{3}}\in\Re^{m\times 1}\), \(\mathbf{b_{4}}\in\Re\) are the bias vectors of the three hidden layers and the output layer. The activation function of the first hidden layer is the _tanh_ function, and the _sigmoid_ function is chosen as the activation function of the other layers and are given by,  
\[f_{1}(*)=\frac{2}{(1+\exp(-2*))}-1 \tag{21}\]  
\[f_{i}(*)=\frac{1}{(1+\exp(-*))}\text{ for }i=2,3,4 \tag{22}\]  
where \({}^{*}\) indicates the input of the above functions. This proposed ANN employs a back-propagation algorithm [24] as the learning rule of a multi-layer neural network to find the optimal weights that can achieve the best mapping between inputs and output. Each weight and bias in (17) through (20) are updated in each iteration (specified as step \(k\)) based on the following rules,  
\[\mathbf{W}_{i|k+1}=\mathbf{W}_{i|k}-\eta_{W}\Bigg{(}\frac{\partial J}{ \partial\mathbf{W}_{i|k}}\Bigg{)}\text{ for }i=1,2,3,4 \tag{23}\]  
\[\mathbf{b}_{i|k+1}=\mathbf{b}_{i|k}-\eta_{b}\Bigg{(}\frac{\partial J}{ \partial\mathbf{b}_{i|k}}\Bigg{)}\text{ for }i=1,2,3,4 \tag{24}\]  
where, \(\eta_{W},\eta_{b}\) are the learning rates of weights and biases. The cross-entropy function is much more sensitive to the error [25]. Due to this reason, the learning rules derived from the cross-entropy function are generally known to yield better performance. The loss function \(J\) used here is defined as,  
\[J=\sum_{s=1}^{M}[-\mathrm{e}_{s}\ln(\mathrm{e}_{s})-(1-\mathrm{e}_{s})\ln(1- \mathrm{e}_{s})] \tag{25}\]  
where \(M\) is the total number of training data and the error, \(\mathrm{e}_{s}=\hat{\mathbf{n}}_{s}-\mathbf{\mu}\), between the outputs of ANN and true references. The specific updated laws are given in the Appendix A. In addition, it should be noted that the training process will be conducted in the LAB environment (off-line procedure) and the best-fitted weights of ANN between input and output data will be transferred to the estimation algorithm for a validation process (furthermore to the controller (ECU) for the actual test). The flow diagram for the training and validation phases are briefly described in Figure 5.  
The pseudo-codes of both data-processing and best-fitted ANN classifier in road friction estimation are shown in the Algorithm 2 and applied to the individual wheel.