# Cyber-Physical Attack Detection and Recovery Based on RNN in Automotive Brake Systems
## 4 Experimental Results
### Classification Accuracy  
In order to generate a test environment, we design the parameters such as attack duration, timing which attacks occur in test datasets. All of the five test datasets followed the Poisson distribution and the Poisson mean \(\lambda\) is set to 0.1 (the average number of events per one second). The Poisson distribution is a probability distribution that indicates the occurrence frequency of events. The occurrence frequency of attacks is depend on the mind of the attacker. Thus, Poisson distribution is suitable for expressing occurrence of attacks randomly and was used for attack data generation. Attack duration is fixed to 0.73 and a type of attack is limited to additive attack as well as random and drift attacks. The accuracy is a measure to show how well states of the wheel speed sensors are classified before calculating the vehicle speed. We check the accuracy by inputting the test data as input data of the RNN classifier. It is necessary to ensure high classification accuracy in that only the data of the normal sensors are used for vehicle speed estimation. The accuracy is 99.4978% when the test datasets are classified by the trained RNN classifier. There are some misclassified data, and we analyze them in order to identify the cause. Figure 5 shows the misclassified data in one of five test datasets. Figure 5 presents the profile of the data input to the RNN classifier after attack injection. Figure 5 illustrates the reference speed obtained from CAN to check that the attack is classified well and the estimated speed after attack detection and speed estimation. The enlargements of each green box of Figure 5,b are displayed in Figure 5,d. As shown in Figure 5,d, data that the green circles indicate are misclassified as false data in spite of data of a normal sensor. The wheel speed value is momentarily higher than the vehicle speed because the four wheels are tightened by disc pads and locked, and then the wheel speeds are compensated by Proportional-Integral-Derivative (PID) control after ABS operation [20]. At that moment, the confusion arises in the classification process. \begin{table}
\begin{tabular}{l c c c c c c c} \hline \hline
**Class** & **0** & **1, 2** & **3, 4** & **5** & **6, 7,** **8, 9** & **10** & **11, 12** & **13, 14** \\ \hline \(W_{tf}\)1 & 0 & 0 & 0 & - & 0 & 0.5 & - & 1 \\ \(W_{lr}\)2 & 0.5 & 0.5 & 1 & 0.5 & 1 & - & 1 & - \\ \(W_{bf}\)3 & 0.44 & 0.9 & 0.45 & - & 0.9 & 0.5 & - & - \\ \(W_{br}\)4 & 0.06 & 0.05 & 0.1 & 0.5 & 0.1 & - & 1 & 1 \\ \hline \hline \end{tabular}  
* A weight of front wheels in traction conditions; 2 A weight of rear wheels in traction conditions; 3 A weight of front wheels in braking conditions; 4 A weight of rear wheels in braking conditions.  
\end{table} 
Table 9: Selected weights of Weighted Average in total classes. On the contrary, although an attack happens on a sensor, there is a result that the RNN classifier predicted as a normal state. Another test dataset is presented in Figure 6. Figure 6a,b show total profiles of the dataset. Data to inject false data into and input to the RNN classifier for attack detection are illustrated in Figure 6a. The reference speed and the estimated speed which WA calculates after attack detection are displayed in Figure 6b. In Figure 6c,d, the green boxes of Figure 6a,b are enlarged, respectively. The green circle indicates that the RNN classifier misclassified the class of the data as  
Figure 5: One of the test datasets: (**a**) Test dataset before attack detection; (**b**) The estimated speed after attack detection and speed estimation and the reference speed; (**c**) A part of the test dataset before attack detection; (**d**) A part of the estimated speed after attack detection and speed estimation and the reference speed. a normal operation though an attack occurred on a sensor as shown in Figure 6c,d. This is because the magnitude of the data is smaller than that of other false data. The data of normal sensors and attacked sensors on which additional attacks happen are learned at the learning step.