# Cyber-Physical Attack Detection and Recovery Based on RNN in Automotive Brake Systems
## 3 Vehicle Speed Estimation
### Weight and Threshold Selection

Table 4: Weight selection of Recursive Filter. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Threshold** & **Traction** & **Braking** \\ \hline \(max(d_{12})\) (FL-FR) & 0.625 & 12.125 \\ \(max(d_{13})\) (FL-RL) & 1.125 & 9.5 \\ \(max(d_{14})\) (FL-RR) & 1 & 10.625 \\ \(max(d_{23})\) (FR-RL) & 1.125 & 12.25 \\ \(max(d_{24})\) (FR-RR) & 1.25 & 11.875 \\ \(max(d_{34})\) (RL-RR) & 0.75 & 7.25 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Threshold selection of Threshold Voting. which is the high value, and weights of both RL and RR are 0.05. As presented in Table 8, the different weights are selected in case of Class 3 and 4 (only one of the rear wheel speed sensors is attacked). The vehicle speed is calculated by weighting only rear wheel speed sensors during traction where both front wheel speed sensors are in normal. By using weights of total classes as presented in Table 9, WA estimates the vehicle speed with the different weights depending on the traction and braking condition. Class 6, 7, 8, and 9 indicate that one of the front sensors and one of the rear sensors are attacked. The ratio of front weights to rear weights in Class 6, 7, 8, and 9 are equal to those of front weights to rear weights in Class 3 and 4 and Class 1 and 2. In other words, since one of the front sensors and one of the rear sensors are in normal, weights in Class 6, 7, 8, and 9 are as twice as weights in a state where all of the sensors are in normal. Because Class 5 and 10 mean that all front sensors or all rear sensors are in normal, 0.5 is assigned as the weight of each normal sensor. Class 11, 12, 13, and 14 indicate that only one of the four sensors is in normal. In this case, data of one sensor under normal operation become a vehicle speed. \begin{table}
\begin{tabular}{l c c c c c c c} \hline \hline \multirow{2}{*}{**Class 0**} & \multicolumn{2}{c}{**Traction**} & \multicolumn{2}{c}{**Braking**} & \multicolumn{2}{c}{**Traction**} & \multicolumn{2}{c}{**Braking**} \\ \cline{2-9}  & **Front** & **Rear** & **Front** & **Rear** & **Front** & **Rear** & **Front** & **Rear** \\ \hline Weight & 0 & 0.5 & 0.45 & 0.05 & 0 & 0.5 & 0.47 & 0.03 \\ MSE & & 1.5612 & & & 1.5619 & & \\ \hline Weight & 0 & 0.5 & 0.5 & 0 & 0 & 0.5 & 0.43 & 0.07 \\ MSE & & 1.5638 & & & 1.5611 & & \\ \hline Weight & 0 & 0.5 & 0.4 & 0.1 & 0 & 0.5 & 0.42 & 0.08 \\ MSE & & 1.5619 & & & 1.5612 & & \\ \hline Weight & **0** & **0.5** & **0.44** & **0.06** & 0.05 & 0.45 & 0.44 & 0.06 \\ MSE & & **1.5611** & & & 1.5765 & & \\ \hline Weight & 0.02 & 0.48 & 0.44 & 0.06 & 0.01 & 0.49 & 0.44 & 0.06 \\ MSE & & 1.5671 & & & 1.5641 & & \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Weight selection of Weighted Average in Class 0 state. \begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline \multirow{2}{*}{**Class 1\&2**} & \multicolumn{2}{c}{**Traction**} & \multicolumn{2}{c}{**Braking**} & \multicolumn{2}{c}{**Traction**} & \multicolumn{2}{c}{**Braking**} \\ \cline{2-9}  & **Front** & **Rear** & **Front** & **Rear** & **Front** & **Rear** & **Front** & **Rear** \\ \hline Weight & **0** & **0.5** & **0.9** & **0.05** & 0.1 & 0.45 & 0.9 & 0.05 \\ MSE & & **1.5612** & & & 1.5766 & & \\ \hline Weight & 0.2 & 0.4 & 0.9 & 0.05 & 0 & 0.5 & 1 & 0 \\ MSE & & 1.593 & & & 1.5638 & & \\ \hline Weight & 0 & 0.5 & 0.8 & 0.1 & & & \\ MSE & & 1.5619 & & & & & \\ \hline \hline \end{tabular}
\end{table} 
Table 7: Weight selection of Weighted Average in Class 1 and 2 states. \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline \multirow{2}{*}{**Class 3\&4**} & \multicolumn{2}{c}{**Traction**} & \multicolumn{2}{c}{**Braking**} & \multicolumn{2}{c}{**Traction**} & \multicolumn{2}{c}{**Braking**} \\ \cline{2-9}  & **Front** & **Rear** & **Front** & **Rear** & **Front** & **Rear** & **Front** & **Rear** \\ \hline Weight & **0** & **1** & **0.45** & **0.1** & 0 & 1 & 0.5 & 0 \\ MSE & & **1.5612** & & & & 1.5638 & & \\ \hline Weight & 0 & 1 & 0.4 & 0.2 & 0.1 & 0.8 & 0.45 & 0.1 \\ MSE & & 1.5619 & & & & 1.593 & \\ \hline Weight & 0.05 & 0.9 & 0.45 & 0.1 &