# Toward Generative AI-Based Intrusion Detection Systems for the Internet of Vehicles (IoV)
## 4 Generative AI-Based IDS for IoV
This BERT-based approach demonstrates superiority over traditional ML methods like PCA and Autoencoders in anomaly detection. VAEs are generative models used in IoV systems to detect anomalies, and they have been applied in various works. For instance, the authors in Ref. [87] propose a method that combines a Conditional VAE (CVAE) with a Random Forest classifier to address issues of data generalization and overfitting in network traffic anomaly detection. The CVAE introduces traffic packet labels into the latent space, allowing better feature learning, while RF enhances classification accuracy. Although this method improves detection rates within a specific dataset, its performance can vary across different datasets and attack types. Meanwhile, in Ref. [88], an Attention-based VAE (A-VAE) is introduced for anomaly detection in traffic video streams. The framework integrates 2D-CNN, Bi-LSTM layers, and an attention mechanism to effectively capture spatial and temporal features. Trained in an unsupervised manner on regular video sequences, this model achieves high real-time detection accuracy in dynamic V2X environments. However, its unsupervised nature means performance might drop if the training data does not adequately represent the diversity of normal traffic patterns. Autoencoders (AEs) are widely used in intrusion detection systems due to their ability to identify anomalies based on reconstruction errors. To enhance detection accuracy in vehicular networks, many studies have incorporated additional techniques into AE-based models. For instance, [PERSON] et al. [89] proposed a hybrid deep learning-based model to detect DDoS attacks by combining an AE and an MLP network while using the CICDDoS2019 dataset to train the model. In this case, the Autoencoder performs feature selection, and the Multi-layer Perceptron classifies the attacks. Impressively, the model achieved an accuracy score of 98.34% and an F1 score of 98.18%, indicating its effectiveness for DDoS detection. Adding to the diversity of approaches, [PERSON] et al. [90] introduced a novel method for detecting anomalies in in-vehicle networks through the use of multiple LSTM-Autoencoder models. This approach was developed in response to the lack of robust security measures within the CAN protocol, which remains vulnerable to a variety of attacks. The proposed method, enhanced by GAI (Genetic Algorithm-based Initialization), delivers a solution that is both accurate and effective for vehicular applications by considering various dynamic features such as transmission intervals and payload value changes. Moreover, [PERSON] and [PERSON] [91] proposed a semi-supervised IDS that integrates a convolutional Autoencoder with a GAN. Their framework involves three training phases: initial Autoencoder training on unlabeled data, joint training with a GAN discriminator, and final fine-tuning using labeled data--achieving strong accuracy with minimal supervision. Further advancing this area, [PERSON] et al. [92] developed AMAEID, an anomaly detection method combining a denoising Autoencoder with an attention mechanism. By injecting Gaussian noise and emphasizing key input features, their model improved robustness and generalization, though it was evaluated only against traditional ML baselines.