## 5 Experimental Results and Analysis
### Performance under a Single Anomaly Scenario  
In this section, we investigate and analyze the detection performance of the proposed CWT-CNN model with five in-vehicle sensor signals under five anomaly scenarios, respectively, as discussed in Section 3.4; namely, we examine the performance under hijack, bias, injection, DOS, and replay. Table 3 illustrates the anomaly detection performance of the five signals under the hijack anomaly scenario. As shown in Table 3, for each in-vehicle sensor signal, our proposed model performs reasonably well, with the average accuracy and F1 score being 95.90% and 95.86%, respectively. The high sensitivity means that when attacks occur, our proposed model can detect almost all of them. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Signal** & **Acc** & **Sens** & **Prec** & **F1** \\ \hline
1 & 96.43 & 95.36 & 97.44 & 96.39 \\
2 & 96.35 & 95.26 & 97.37 & 96.31 \\
3 & 96.25 & 95.50 & 96.95 & 96.22 \\
4 & 95.31 & 94.06 & 96.47 & 95.25 \\
5 & 95.18 & 94.10 & 96.18 & 95.13 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Detection performance of the proposed model under the hijack scenario. As can be seen from Table 4, the proposed model can achieve an average accuracy of 95.53% and an F1 score of 95.48% for all five sensor signals under the bias anomaly scenario. Compared with the performance of the hijack scenario, the model performs slightly worse; this is because the bias scenario causes smaller deviations from true values, which increases the difficulty of anomaly detection. However, the performance shown in the table is practical for anomalies in the bias scenario because small deviations have negligible effects on sensors and vehicles. Table 5 shows the result of our proposed model under the injection scenario. Under the injection scenario, the model has a better detection performance with an average accuracy of 97.93% and F1 score of 97.91% compared with those under the hijack and bias scenarios. This is because a greater number of anomaly magnitudes within the detection window is caused by injection behavior, which will make the attacks much easier to be detected by anomaly detection models. Table 6 shows the anomaly detection performance of the model in the DOS scenario. It can be observed that the proposed model can achieve an average accuracy of 98.99% and has an F1 score of 98.98%. In addition, it can be observed that the performance of the model for the DOS scenario is better than that of the other four attack types, which is because the high-frequency changes caused by DOS attacks will cause a large number of deviations from the normal behavior pattern in the detection window, thus making this attack easier to be captured by the model and detected. Table 7 shows the detection performance under the replay scenario. It can be seen that the model also has a good performance. However, compared with the other scenarios, the performance of replay is slightly weakened because the CAN message recorded by the attacker before the attack and the replay message are likely to be similar, which will increase the difficulty of model detection, meaning that the detection ability will be reduced. In conclusion, the proposed model can achieve a better detection result for different attack scenarios. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Signal** & **Acc** & **Sens** & **Prec** & **F1** \\ \hline
1 & 99.39 & 98.85 & 99.93 & 99.39 \\
2 & 99.31 & 98.70 & 99.91 & 99.30 \\
3 & 99.45 & 98.95 & 99.95 & 99.44 \\
4 & 98.49 & 97.48 & 99.48 & 98.47 \\
5 & 98.32 & 97.22 & 99.40 & 98.30 \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Detection performance of the proposed model under the DOS scenario. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Signal** & **Acc** & **Sens** & **Prec** & **F1** \\ \hline
1 & 95.91 & 94.83 & 96.93 & 95.87 \\
2 & 96.05 & 95.10 & 96.94 & 96.01 \\
3 & 95.86 & 94.73 & 96.93 & 95.81 \\
4 & 95.01 & 93.76 & 96.17 & 94.95 \\
5 & 94.85 & 93.76 & 95.84 & 94.79 \\ \hline \hline \end{tabular}
\end{table}