## 6 Conclusions and Future Work  
In this paper, we proposed a novel anomaly detection model based on the time and frequency domain characteristics of in-vehicle sensor messages. The CWT method was used to convert the raw sensor signal into the two-dimensional CWTS for obtaining the complete time and frequency domain information with high scales. We exploited CNN to extract the features of vehicle behavior patterns to detect vehicle anomalies from the input CWTS to take advantage of its powerful capability of classifying two-dimensional data. We implemented various experiments on a real-world driving dataset to evaluate the detection performance of our proposed model. The results show that our model can achieve high accuracy, sensitivity, precision, and F1 score under different anomaly scenarios. Compared with the related research, the average accuracy and F1 score of anomaly detection were improved by 2.51% and 2.46%, respectively.  
Our work confirmed the effectiveness, superiority, and broad application prospects of using a wavelet transform time-frequency analysis method combined with a CNN for  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Durations** & **Model** & **Acc** & **Sens** & **Prec** & **F1** \\ \hline \multirow{4}{*}{50} & MIDS & 83.58 & 84.16 & 83.19 & 83.67 \\  & RNet & 90.79 & 88.92 & 92.37 & 90.61 \\  & CWT-CNN & 94.53 & 92.96 & 95.97 & 94.44 \\ \hline \multirow{4}{*}{100} & MIDS & 89.58 & 90.50 & 88.87 & 89.67 \\  & RNet & 92.96 & 91.84 & 93.95 & 92.88 \\  & CWT-CNN & 95.55 & 94.16 & 96.84 & 95.48 \\ \hline \multirow{4}{*}{150} & MIDS & 92.31 & 93.56 & 91.28 & 92.41 \\  & RNet & 94.74 & 93.25 & 96.11 & 94.66 \\  & CWT-CNN & 96.03 & 95.03 & 96.97 & 95.99 \\ \hline \multirow{4}{*}{200} & MIDS & 93.36 & 95.06 & 91.94 & 93.47 \\  & RNet & 95.33 & 94.15 & 96.43 & 95.28 \\ \cline{1-1}  & CWT-CNN & 96.66 & 96.16 & 97.13 & 96.65 \\ \hline \hline \end{tabular}
\end{table}
Table 11: Comparison with other methods under different anomaly durations.  
Figure 7: Comparison under different anomaly durations with the evaluation criteria of (**a**) accuracy, (**b**) sensitivity, (**c**) precision, and (**d**) F1 score.  
vehicle anomaly detection. To the best of our knowledge, this is the first work that exploits a signal analysis method with deep learning technology in the CAVs anomaly detection field. However, there are some limitations in this work, which can be improved in our future work. First, the continuous wavelet transform technique has some redundancy in signal processing. In a future work, we will optimize the data processing and analysis method for the time-frequency domain to enhance the performance in real-time. In addition, due to the requirement of using sliding windows to maintain the real-time CAN data as the input of the detection system, there will be an edge effect when the finite length data sequence is subjected to the continuous wavelet transform, which may potentially affect the detection performance based on CNN. In a future work, we will take the impact of the edge effect into consideration and optimize the feature maps and CNN models so that our method can achieve a better detection performance.  
[PERSON] performed the data preprocessing, contributed to the design and construction the model, performed the experiments, executed the detailed result analysis, and wrote some sections. [PERSON] set the objectives of the research, wrote some sections, and proofread the manuscript. All authors have read and agreed to the published version of the manuscript.  
This research was funded by the National Natural Science Foundation of China under Grant No. 61802252.  
Not applicable.  
Data Availability StatementData are available from the author upon request.  
The authors declare no conflict of interest.