VAE-Based Real-Time Anomaly Detection Approach for Enhanced V2X Communication Security
Abstract
:1. Introduction
- We propose a novel real-time anomaly detection framework that leverages a sliding window mechanism in combination with a VAE integrated with a CNN architecture, resulting in a lightweight and robust model.
- The performance of the proposed model is rigorously evaluated using a custom Basic Safety Message dataset, where various anomalies were systematically injected to simulate real-world scenarios.
2. Related Work
2.1. Key Considerations
- Inference time: We considered the importance of low-latency processing to meet real-time detection requirements in V2X environments.
- Detection accuracy: We focused on designing a model capable of identifying anomalies without relying on labeled attack data.
- Unsupervised problem: The solution was developed under an unsupervised setting to ensure practicality, given the difficulty of obtaining labeled anomalies in real-world V2X data.
- Deployability: We aimed for lightweight and modular architecture that is suitable for deployment on resource-constrained devices, such as OBUs and RSUs.
2.2. Recent Studies on Anomaly Detection in V2X Communications
2.3. The Novelty of This Study
3. Proposed Methodology
3.1. Attack Model
- Attacker Access and Capabilities: We assume an attacker who has gained the ability to inject or manipulate BSMs within the V2X communication channel. This could be achieved through various means, such as compromising an OBU of a vehicle or an RSU by employing a rogue device capable of broadcasting V2X messages that mimic legitimate ones. An attacker can also exploit vulnerabilities in the V2X communication stack to alter messages in transit, e.g., a man-in-the-middle [23] scenario. The attacker is assumed to be familiar with the BSM format and content, but not necessarily with the internal parameters of the deployed anomaly detection system. Their goal is to introduce false information regarding a vehicle’s state (position, speed, acceleration) to disrupt V2X applications, potentially leading to unsafe conditions or reduced traffic efficiency.
- Resources Used by Attacker: An attacker might utilize software-defined radios (SDRs) [24] or custom-programmed V2X communication modules to craft and transmit anomalous BSMs. For attacks involving compromised OBUs/RSUs, the attacker leverages the existing communication hardware of the compromised unit. The injected anomalies, as simulated in our experiments in Section 4.2, such as constant offsets or targeted vehicle data falsification, represent attempts to broadcast deceptive kinematic information.
3.2. Real-Time Anomaly Detection Model
- Step 1: Incoming messages are filtered in the preprocessing stage to retain only the essential features (position, speed, and acceleration), then normalized to the range [0, 1] using MinMaxScaler. This normalization process helps stabilize training and enhances model performance [27].
- Step 2: A sliding window approach is used to generate overlapping time-series windows [28], with each window containing four consecutive data points and a stride of one. This approach effectively enables the model to capture temporal dependencies within the data.
- Steps 3–6: The model analyzes each sliding window in real-time to determine whether it is anomalous or normal. If a window is classified as anomalous, an alarm is triggered, and the corresponding data is sent to an anomaly storage unit for further investigation. On the other hand, if the window is deemed normal, it is aggregated into a separate storage unit for normal data, which contributes to the dataset for periodic model retraining. The model retraining stage is executed at determined intervals to ensure the model remains updated with evolving data distributions. During retraining, the dataset is preprocessed using the same sliding window approach.
- Step 7: Following retraining and recalibration of the anomaly detection threshold, the updated model is deployed for continued real-time anomaly detection.
4. Experimental Setup and Results
4.1. Dataset Collection and Experiment Setup
4.2. Anomaly Injection and Evaluation Metrics
- Precision (P): Precision measures the proportion of correctly identified anomalies among all the instances flagged as anomalies by the model. It is defined as
- Recall (R): Recall measures the model’s ability to accurately identify all actual anomalies. It is defined as
- F1-Score: The F1-score provides a harmonic mean of precision and recall, offering a single measure that balances the trade-off between these two metrics. It is calculated as
- Accuracy (A): Accuracy is a measure of the proportion of correct predictions (both positive and negative) made by the model out of the total number of predictions. It is mathematically defined as
4.3. Performance Evaluation
5. Discussion
5.1. Interpretation of Results and the Implications for V2X Security
5.2. Limitations of Our Model
5.3. Future Research Direction
6. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Data Availability Statement
Conflicts of Interest
Abbreviations
VAE | Variational Autoencoder |
LSTM | Long Short-Term Memory |
CNN | Convolutional Neural Network |
V2X | Vehicle-to-Everything |
ITS | Intelligent Transportation Systems |
GAN | Generative Adversarial Network |
RSU | Roadside Unit |
OBU | On-Board Unit |
KL | Kullback–Leibler |
SUMO | Simulation of Urban Mobility |
References
- Yogarayan, S.; Razak, S.F.A.; Azman, A.; Mohd, F.A. Abdullah, Vehicle to Everything (V2X) Communications technology for Smart Mobility in Malaysia: A comprehensive Review. J. Southwest Jiaotong Univ. 2021, 56, 534–563. [Google Scholar] [CrossRef]
- Dokur, O.; Katkoori, S. Three Connected V2V Applications Based on DSRC Basic Safety Messages. In Proceedings of the ICCVE 2022—IEEE International Conference on Connected Vehicles and Expo, Lakeland, FL, USA, 7–9 March 2022. [Google Scholar] [CrossRef]
- El Azzaoui, A.; Jeremiah, S.R.; Xiong, N.N.; Park, J.H. A digital twin-based edge intelligence framework for decentralized decision in IoV system. Inf. Sci. 2023, 649, 119595. [Google Scholar] [CrossRef]
- Sandeep, Y.; Venugopal, P. In-depth evaluation of security requirements and attacks for secure data communication in ITS. AIP Conf. Proc. 2024, 2966, 030002. [Google Scholar] [CrossRef]
- Enrique, O.; Castro, L.; Deng, X.; Park, J.H. Comprehensive Survey on AI-Based Technologies for Enhancing IoT Privacy and Security: Trends, Challenges, and Solutions. Hum.-Centric Comput. Inf. Sci. 2023, 13, 39. [Google Scholar] [CrossRef]
- Ha, N.B.; Jeong, Y.S. Fusion of Digital Twin and Blockchain for Secure and Efficient IoV Networks. Hum.-Centric Comput. Inf. Sci. 2024, 14, 1–17. [Google Scholar] [CrossRef]
- Gularte, K.H.M.; Vargas, J.A.R.; da Costa, J.P.J.; Da Silva, A.A.S.; Santos, G.A.; Wang, Y.; Müller, C.A.; Lipps, C.; Júnior, R.T.d.S.; Filho, W.d.B.V.; et al. Safeguarding the V2X Pathways: Exploring the Cybersecurity Landscape Through Systematic Review. IEEE Access 2024, 12, 72871–72895. [Google Scholar] [CrossRef]
- Zhang, R.; Xiong, K.; Du, H.; Niyato, D.; Kang, J.; Shen, X.; Poor, H.V. Generative AI-enabled Vehicular Networks: Fundamentals, Framework, and Case Study. IEEE Netw. 2024, 38, 259–267. [Google Scholar] [CrossRef]
- Pinto, A.; Herrera, L.C.; Donoso, Y.; Gutierrez, J.A. Enhancing Critical Infrastructure Security: Unsupervised Learning Approaches for Anomaly Detection. Int. J. Comput. Intell. Syst. 2024, 17, 236. [Google Scholar] [CrossRef]
- Bauer, L.A.; Bindschaedler, V. Generative Models for Security: Attacks, Defenses, and Opportunities. 2021. Available online: https://arxiv.org/abs/2107.10139v2 (accessed on 16 July 2024).
- Jeremiah, S.R.; Ha, J.; Singh, S.K.; Park, J.H. PrivacyGuard: Collaborative Edge-Cloud Computing Architecture for Attribute-Preserving Face Anonymization in CCTV Networks. Hum.-Centric Comput. Inf. Sci. 2024, 14, 43. [Google Scholar] [CrossRef]
- Chaitou, H.; Robert, T.; Leneutre, J.; Pautet, L. Intrinsic Weaknesses of IDSs to Malicious Adversarial Attacks and Their Mitigation. Commun. Comput. Inf. Sci. 2023, 1849, 122–155. [Google Scholar] [CrossRef]
- Halvorsen, J.; Izurieta, C.; Cai, H.; Gebremedhin, A. Applying Generative Machine Learning to Intrusion Detection: A Systematic Mapping Study and Review. CM Comput. Surv. 2024, 56, 1–33. [Google Scholar] [CrossRef]
- Devika, S.; Shrivastava, R.R.; Narang, P.; Alladi, T.; Yu, F.R. VADGAN: An Unsupervised GAN Framework for Enhanced Anomaly Detection in Connected and Autonomous Vehicles. IEEE Trans. Veh. Technol. 2024, 73, 12458–12467. [Google Scholar] [CrossRef]
- Huang, W.; Xu, H.; Gong, Y.; Liu, Z.; Li, F.; Lin, Z.; Hu, B.-J. UltraADV: An Unsupervised Deep Learning Lightweight Framework for Anomaly Detection in V2X. IEEE Internet Things J. 2024, 12, 12735–12747. [Google Scholar] [CrossRef]
- Khanmohammadi, F.; Azmi, R. Time-Series Anomaly Detection in Automated Vehicles Using D-CNN-LSTM Autoencoder. IEEE Trans. Intell. Transp. Syst. 2024, 25, 9296–9307. [Google Scholar] [CrossRef]
- Al-Yarimi, F.A.M. Enhancing road safety through advanced predictive analytics in V2X communication networks. Comput. Electr. Eng. 2024, 115, 109134. [Google Scholar] [CrossRef]
- Zhao, L.; Fan, X.; Hawbani, A.; Xu, L.; Yu, K.; Liu, Z.; Alfarraj, O. Generative Abnormal Data Detection for Enhancing Cellular Vehicle-to-Everything Based Road Safety. IEEE Trans. Green Commun. Netw. 2024, 8, 1466–1478. [Google Scholar] [CrossRef]
- Qian, H.; Chai, H.; Hawbani, A.; Bi, Y.; Lin, N.; Zhao, L. A Collaborative Error Detection and Correction Scheme for Safety Message in V2X. IEEE Trans. Mob. Comput. 2024, 24, 2594–2611. [Google Scholar] [CrossRef]
- Venkatasamy, T.K.; Hossen, M.J.; Ramasamy, G.; Aziz, N.H.B.A. Intrusion detection system for V2X communication in VANET networks using machine learning-based cryptographic protocols. Sci. Rep. 2024, 14, 31780. [Google Scholar] [CrossRef]
- Asaju, B.J. Advancements in Intrusion Detection Systems for V2X: Leveraging AI and ML for Real-Time Cyber Threat Mitigation. J. Comput. Intell. Robot. 2024, 4, 33–50. [Google Scholar] [CrossRef]
- John, B. Machine Learning-Based Anomaly Detection in V2V and V2X Networks. 2025. Available online: https://www.researchgate.net/publication/389089255 (accessed on 28 May 2025).
- Ahmad, F.; Adnane, A.; Franqueira, V.N.L.; Kurugollu, F.; Liu, L. Man-In-The-Middle Attacks in Vehicular Ad-Hoc Networks: Evaluating the Impact of Attackers’ Strategies. Sensors 2018, 18, 4040. [Google Scholar] [CrossRef]
- Mo, R.; Wu, B.; Tan, Z.; Qiu, H. Poster Abstract: SEE-V2X: Empirical Evaluation of C-V2X Direct Communica-tion in Real-World Scenarios. In Proceedings of the 23rd ACM Conference on Embedded Networked Sensor Systems, Irvine, CA, USA, 6–9 May 2025; pp. 598–599. [Google Scholar] [CrossRef]
- Wei, R.; Garcia, C.; El-Sayed, A.; Peterson, V.; Mahmood, A. Variations in Variational Autoencoders—A Comparative Evaluation. IEEE Access 2020, 8, 153651–153670. [Google Scholar] [CrossRef]
- Harang, R.; Sanders, H. Catastrophic Forgetting in the Context of Model Updates. 2023. Available online: https://arxiv.org/abs/2306.10181v1 (accessed on 5 June 2025).
- Cabello-Solorzano, K.; de Araujo, I.O.; Peña, M.; Correia, L.; Tallón-Ballesteros, A.J. The Impact of Data Normalization on the Accuracy of Machine Learning Algorithms: A Comparative Analysis. Lect. Notes Netw. Syst. 2023, 750, 344–353. [Google Scholar] [CrossRef]
- Yin, C.; Zhang, S.; Wang, J.; Xiong, N.N. Anomaly Detection Based on Convolutional Recurrent Autoencoder for IoT Time Series. IEEE Trans. Syst. Man, Cybern. Syst. 2020, 52, 112–122. [Google Scholar] [CrossRef]
- Cinelli, L.P.; Marins, M.A.; da Silva, E.A.B.; Lima Netto, S. Variational Autoencoder. In Variational Methods for Machine Learning with Applications to Deep Networks; Springer International Publishing: Cham, Switzerland, 2021; pp. 111–149. [Google Scholar] [CrossRef]
- Liu, Y.; Zhao, Z.; Zhang, S.; Jung, U. Identification of Abnormal Processes with Spatial-Temporal Data Using Convolutional Neural Networks. Processes 2020, 8, 73. [Google Scholar] [CrossRef]
- Szandała, T. Review and Comparison of Commonly Used Activation Functions for Deep Neural Networks. Stud. Comput. Intell. 2021, 903, 203–224. [Google Scholar] [CrossRef]
- Burgess, C.P.; Higgins, I.; Pal, A.; Matthey, L.; Watters, N.; Desjardins, G.; Lerchner, A. Understanding Disentangling in β-VAE. arXiv 2018, arXiv:1804.03599. [Google Scholar] [CrossRef]
- SUMO Documentation. Available online: https://sumo.dlr.de/docs/index.html (accessed on 19 September 2024).
- FCDOutput—SUMO Documentation. Available online: https://sumo.dlr.de/docs/Simulation/Output/FCDOutput.html (accessed on 5 June 2025).
- Metzner, A.; Wickramarathne, T. Exploiting Vehicle-to-Vehicle Communications for Enhanced Situational Awareness. In Proceedings of the 2019 IEEE Conference on Cognitive and Computational Aspects of Situation Management, CogSIMA, Las Vegas, NV, USA, 8–11 April 2019; pp. 88–92. [Google Scholar] [CrossRef]
- Welcome To Colab—Colab. Available online: https://colab.research.google.com/ (accessed on 29 December 2024).
- Nabila, P.; Setiawan, E.B. Adam and AdamW Optimization Algorithm Application on BERT Model for Hate Speech Detection on Twitter. In Proceedings of the 2024 International Conference on Data Science and Its Applications (ICoDSA), Bali, Indonesia, 10–11 July 2024; pp. 346–351. [Google Scholar] [CrossRef]
- Voce, G.; Griffith, H.; Rathore, H. Avoiding False Social Conformity in Majority-Malicious Connected Vehicle Networks Employing Consensus-Based Reputation Estimates. In Proceedings of the Digest of Technical Papers—IEEE International Conference on Consumer Electronics, Las Vegas, NV, USA, 6–8 January 2024. [Google Scholar] [CrossRef]
- Jin, K.; Han, X.; Wang, H. Conquering Ghosts: Relation Learning for Information Reliability Representation and End-to-End Robust Navigation. arXiv 2022, arXiv:2203.09952. [Google Scholar] [CrossRef]
- Jin, H.; Papadimitratos, P. Accountable, Scalable and DoS-resilient Secure Vehicular Communication. Comput. Secur. 2025, 156, 104469. [Google Scholar] [CrossRef]
Model | Anomaly Type | Precision | Recall | Accuracy | F1-Score | High-Value Factor | Inference Time |
---|---|---|---|---|---|---|---|
Autoencoder | Constant Position Offset | 0.8467 | 0.9997 | 0.9456 | 0.9168 | 0.5 | 0.0010 |
Constant Speed Offset | 0.8021 | 0.7338 | 0.8657 | 0.7664 | 0.6 | 0.0014 | |
Vehicle Position Offset | 0.7160 | 0.9879 | 0.9440 | 0.8303 | 0.6 | 0.0011 | |
Vehicle Speed Offset | 0.6808 | 0.8356 | 0.9229 | 0.7503 | 1.2 | 0.0012 | |
VAE-LSTM layers | Constant Position Offset | 0.8930 | 0.9997 | 0.9640 | 0.9433 | 0.5 | 0.0029 |
Constant Speed Offset | 0.8865 | 0.9357 | 0.9448 | 0.9104 | 0.6 | 0.0034 | |
Vehicle Position Offset | 0.1679 | 0.7722 | 0.8594 | 0.2758 | 0.6 | 0.0030 | |
Vehicle Speed Offset | 0.1925 | 0.9080 | 0.8648 | 0.3177 | 1.2 | 0.0032 | |
Our VAE-CNN layers | Constant Position Offset | 0.9101 | 0.9998 | 0.9703 | 0.9528 | 0.5 | 0.0013 |
Constant Speed Offset | 0.9081 | 0.9540 | 0.9572 | 0.9305 | 0.6 | 0.0014 | |
Vehicle Position Offset | 0.8237 | 0.9604 | 0.9660 | 0.8868 | 0.6 | 0.0012 | |
Vehicle Speed Offset | 0.8271 | 0.9397 | 0.9644 | 0.8798 | 1.2 | 0.0013 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Gebrezgiher, Y.T.; Jeremiah, S.R.; Gritzalis, S.; Park, J.H. VAE-Based Real-Time Anomaly Detection Approach for Enhanced V2X Communication Security. Appl. Sci. 2025, 15, 6739. https://doi.org/10.3390/app15126739
Gebrezgiher YT, Jeremiah SR, Gritzalis S, Park JH. VAE-Based Real-Time Anomaly Detection Approach for Enhanced V2X Communication Security. Applied Sciences. 2025; 15(12):6739. https://doi.org/10.3390/app15126739
Chicago/Turabian StyleGebrezgiher, Yonas Teweldemedhin, Sekione Reward Jeremiah, Stefanos Gritzalis, and Jong Hyuk Park. 2025. "VAE-Based Real-Time Anomaly Detection Approach for Enhanced V2X Communication Security" Applied Sciences 15, no. 12: 6739. https://doi.org/10.3390/app15126739
APA StyleGebrezgiher, Y. T., Jeremiah, S. R., Gritzalis, S., & Park, J. H. (2025). VAE-Based Real-Time Anomaly Detection Approach for Enhanced V2X Communication Security. Applied Sciences, 15(12), 6739. https://doi.org/10.3390/app15126739