Research Paper:
LSTM–AttnAE: A Hybrid Model for Sybil Attack Detection in VANETs
Hailing Bao
, Ligang Cong
, Xu Liu
, Qingyun Liang
, and Rongpu Wang

School of Computer Science and Technology, Changchun University of Science and Technology
No.7186 Weixing Road, Changchun, Jilin 130022, China
Corresponding author
As a core component of intelligent transportation systems, vehicular ad hoc networks (VANETs) are critical to traffic efficiency and public safety. However, their security is severely threatened by Sybil attacks, whose stealthy and destructive nature complicates detection. To address this issue, this study proposes LSTM–AttnAE, a hybrid anomaly detection model that integrates LSTM, autoencoder, and attention mechanisms. Unlike conventional methods, it leverages LSTM for temporal feature extraction, an autoencoder for self-learning normal behavioral patterns, and an attention module to dynamically prioritize critical features (boosting detection sensitivity). Experiments on the VeReMi extended dataset showed that the model outperformed traditional approaches, achieving 99% precision and 98% recall. This study provides an effective technical solution for VANET security and new insights into anomaly detection in complex networks.
Framework of the LSTM-AttnAE model
1. Introduction
As a core component of intelligent transportation systems, vehicular ad hoc networks (VANETs) establish dynamic collaborative networks through real-time interconnections between vehicles, vehicles and infrastructure, and cloud platforms. This intelligent network enhances road safety, traffic efficiency, and user experience. In VANETs, vehicles form self-organizing networks via onboard units (OBUs) and roadside units (RSUs), using wireless communication technologies such as IEEE 802.11p or 5th generation mobile networks for an efficient, low-latency data exchange. This decentralized communication model enables vehicles to monitor real-time environmental conditions, share data through instant communication, and respond swiftly to dynamic traffic events.
In VANETs, message types are primarily categorized into safety, traffic efficiency, infotainment, and emergency event messages. These messages serve various purposes including collision warning, traffic flow optimization, congestion reduction, improved road efficiency, rapid emergency response, and coordinated avoidance during incidents. However, their effectiveness depends largely on the authenticity, integrity, and reliability of the information exchanged between OBUs and RSUs. Consequently, security issues have become a critical challenge in VANETs. As these networks expand in scale, their openness and dynamic nature further intensify the security risks. A recent comprehensive survey by Hadri et al. further confirms that Sybil attacks have emerged as one of the most pressing threats to VANET security, with their impact expanding as vehicular connectivity increases 1.
The concept of Sybil attacks was first formally proposed by Douceur in 2002 2. Attackers infiltrate networks by creating multiple fake identities (Sybil nodes), masquerading as legitimate vehicles to send false information to other vehicles or RSUs. This manipulation of network data flow or content can lead to traffic decision system failures or even accidents. Current anomaly detection methods for Sybil attacks are primarily categorized into three types: traditional methods such as 3,4,5,6,7,8,9,10,11,12,13, machine learning approaches such as 14,15,16,17,18,19,20, and deep learning frameworks including 21,22,23,24.
Traditional methods typically estimate node positions using the received signal strength indicator (RSSI), compare them with the actual coordinates in beacon messages and set thresholds for attack detection. However, these static threshold-based assumptions are susceptible to feature drift in dynamic topology scenarios and cannot adapt to the frequent network topology changes caused by high-speed vehicle movement, leading to high false detection rates and even more prominent high false positive rate limitations in ultra-dense VANET scenarios 25. In dense urban traffic scenarios with high vehicle density and frequent topology changes, multipath effects and occlusions further increase the difficulty of identifying location spoofing attacks. To address this limitation, Chen et al. proposed a multi-source data fusion framework that effectively improves detection accuracy in complex environments by fusing the vehicle position, traffic state, and sensor verification information 26.
Machine learning-based methods mainly employ supervised learning to classify normal and abnormal nodes, with algorithms such as support vector machines (SVMs) and random forests widely adopted owing to their high detection performance. However, these methods typically rely on predefined features and labels, require massive annotated data, and demonstrate limited capability for effective modeling of high-dimensional heterogeneous data. Multi-source heterogeneous data generated by vehicles (for example, position, speed, and RSSI) contain redundancy and noise, complicating the extraction of discriminative spatiotemporal features by traditional methods and thus limiting their generalization ability. In highway scenarios in which vehicles move at high speeds and exhibit strong temporal dependence, these static feature-based methods fail to capture dynamic changes in vehicle behavior, leading to high false detection rates and delayed responses to dynamic attacks.
Deep learning methods mainly adopt time series and neural network models such as long short-term memory (LSTM), deep regression models, and extreme learning machines to identify Sybil nodes by capturing the temporal dependencies of vehicle behavior. However, existing studies typically focus on long-term temporal dependencies while neglecting the balance between local critical features and long-term dependencies, leading to insufficient adaptability to heterogeneous vehicle data. Furthermore, they often overlook the diversity and stealth of attack patterns, complicating the management of attack scenarios involving multiple fake identities and false location information. Additionally, threshold settings relying on global statistical information ignore individual behavioral differences, resulting in high false positive rates and poor robustness in complex scenarios. As Sultana et al. emphasized, the static feature weighting design fails to capture the diversity of Sybil attack patterns, reducing detection sensitivity to subtle anomalies 27.
To address these critical technical bottlenecks, this study proposes an LSTM–AttnAE anomaly detection hybrid model. The main contributions of this study are the following three aspects:
-
1.
Dynamic focus on key features: The attention mechanism dynamically weighted time steps, enabling the model to automatically focus on critical attack features (for example, signal surges and behavior mutations), enhancing the sensitivity to subtle anomalies and addressing the diversity and stealth of attack patterns.
-
2.
LSTM–AttnAE hybrid model: This model combined LSTM to capture temporal dependencies and resolve feature drift in dynamic topologies, and an autoencoder to compress high-dimensional data and reduce redundancy and noise. The attention mechanism further refocused on critical features, improving the accuracy of location forgery detection and the overall efficiency.
-
3.
Personalized adaptive threshold: A dynamic threshold was derived from vehicle historical data to adapt to environmental and driving habit differences, reducing misjudgment and mitigating high false positive rates caused by global static thresholds.
The remainder of this paper is organized as follows. Section 2 introduces the related works. Section 3 describes the proposed detection method. Section 4 presents an experimental simulation to verify the advantages of the proposed method in terms of precision and AUC. Finally, Section 5 presents the conclusions.
3. Proposed Method
The proposed method consists of data preprocessing and an LSTM–AttnAE model. The raw data undergo preprocessing before being fed into the proposed model. This model adopts a hierarchical architecture comprising multiple layers for feature extraction and reconstruction output. The feature extraction module integrates LSTM, an autoencoder, and attention mechanism. Specifically, an attention mechanism is incorporated after the input to the LSTM layer of the encoder to dynamically weight the important parts of the sequence, thereby enhancing the ability of the model to capture critical information. The output from the attention layer is further passed into stacked dense layers for advanced feature extraction and transformation. Finally, the decoder layer of the LSTM reconstructs the original data. Anomalies are detected based on the distribution of reconstruction errors from the training and validation sets. The next part of this section presents a detailed description of the proposed method.
3.1. Data Preprocessing
Histogram and boxplot analyses reveal that certain features exhibit significant skewness that can potentially impact subsequent model training. To ensure data quality, missing values are addressed by comparing multiple imputation methods, with forward filling ultimately adopted to handle them. Duplicate records are removed to ensure the uniqueness of each sample. To eliminate scale differences among the features, data normalization is performed using the \(z\)-score method, scaling the feature values to the range of \([0, 1]\). The formula used is as follows:
Considering the highly dynamic and real-time nature of vehicular network data, to enhance the capability of capturing short-term behavioral patterns, the data are segmented using fixed time windows, with each time window treated as an independent input sample. Each window contains a fixed number of time steps \(T\), and the corresponding features and labels are extracted. Assuming a window size of \(T\) and a time series denoted by \(X=[x_{1}, x_{2},\ldots, x_{n}]\), the windowed data can be represented as follows, where \(i\) denotes the starting index of the window.
The window size is determined based on the communication characteristics of vehicular networks. In terms of node mobility, the average speed of vehicles in VANETs is approximately 60 km/h, meaning that the vehicle travels approximately 83 m within 5 s; this indicates that the communication topology of nodes changes significantly in a short time. Combined with the 1-s sampling frequency of the dataset, a window size of \(T=5\) is extremely small to capture stable behavioral features, whereas a window size of \(T=15\) introduces redundant information and increases computational overhead. We set the window sizes to {5,10,15,20} for experimental evaluation, and the results show that \(T=10\) achieves the optimal balance between detection accuracy and computational efficiency. Therefore this window size was finally selected.
3.2. Proposed LSTM–AttnAE Model
Deep learning can help represent massive amounts of network traffic with more discriminative feature spaces. This technology employs multiple processing layers to accurately model the input features. Compared with traditional manual feature descriptions, this approach offers advantages because deep learning techniques can automatically extract discriminative features compared to manually generated features. However, traditional LSTM models often struggle with complex vehicle network data because they lack the ability to assign varying degrees of attention to sub-window features across multiple time steps. They frequently encounter issues such as single temporal dependency, feature loss, and reliance on preset thresholds.

Fig. 4. Framework of the LSTM–AttnAE model: encoder–decoder architecture with LSTM layers and a self-attention module.
Inspired by 35, this study developed an LSTM-autoencoder fusion model with an attention mechanism for anomaly detection, named LSTM–AttnAE. The model comprises of three modules: an LSTM encoder, attention module, and LSTM decoder. To reduce the temporal dependency and enhance the ability of the model to capture feature diversity in vehicle network time-series data, this study integrates attention mechanisms after the LSTM encoder output to improve key feature tracking and prevent feature loss. Additionally, this study adopts autoencoders in the anomaly detection model because they aim to learn the optimal parameters for reconstructing the input patterns at the output layer.
The proposed model progressively extracts temporal sequence features using an LSTM encoder layer to capture temporal dependencies in the data, as illustrated in Fig. 4. The LSTM encoder processes the input time-series features to capture temporal dependencies and generates hidden states that encode historical behavioral contexts. This study employs a unidirectional LSTM to preserve the natural forward flow of vehicular data, ensuring that the model focuses on historical patterns to predict future states.
Subsequently, to ensure technical completeness, the key design choices of the scaled dot-product attention mechanism are elaborated; the 64-dimensional outputs of the LSTM encoder are projected onto 64-dimensional \(Q\), \(K\), and \(V\) vectors, preserving critical temporal information while maintaining computational efficiency. For weight matrix initialization, the Xavier uniform initialization strategy is employed to mitigate vanishing or exploding gradient issues. A single-head self-attention architecture is adopted instead of multi-head attention because vehicular network temporal sequences exhibit strong local correlations, making a single-head design sufficient to capture short-term dependencies while avoiding excessive overhead.
Subsequently, the scaled dot-product attention layer weights the LSTM outputs, dynamically emphasizing the critical time steps associated with anomalous behavior. This enhances the focus on key time points while appropriately suppressing non-critical information, thereby enabling the model to concentrate on significant temporal anomalies. This approach mitigates numerical instability in attention weight calculations, ensuring a smooth weight distribution across time steps and improving sensitivity to stealthy attacks. The attention layer further maps the data into high-dimensional feature representations, automatically extracting stage-specific characteristics during this process.
After attention weighting, stacked dense layers perform dimensionality reduction and non-linear feature transformation using ReLU activation, reducing the computational complexity while preserving critical temporal and attention-aware features. The LSTM decoder reconstructs the original input sequence from the compressed features and is initialized with the final hidden state of the encoder to maintain temporal coherence. The model attempts to reconstruct the original input data based on these high-dimensional features, with the reconstruction errors serving as key indicators for subsequent anomaly detection.
Finally, the autoencoder reconstruction step compares the decoder output with the original input, using reconstruction errors (measured using the MSE) to identify anomalies. Samples with reconstruction errors exceeding a learned threshold are flagged as anomalous, leveraging the ability of the autoencoder to model the normal behavior in an unsupervised manner.
Throughout this process, the data undergo multi-layered feature extraction and transformation from the original input sequence, ultimately enabling anomaly detection. This architecture leverages three core strengths: the temporal modeling capability of LSTM, the efficient information extraction of the attention mechanism, and the robust compression and reconstruction properties of the autoencoder. Thus, it achieves efficient compression and anomaly detection of time-series data. To further clarify the synergistic working principle of the model components and the solutions to technical challenges during integration, the relevant details are elaborated in the subsequent sections.
3.3. Model Fusion Mechanism and Technical Challenges
The LSTM–AttnAE model achieves robust anomaly detection through the synergistic interaction of its core components. The LSTM module acts as the temporal backbone of the framework, encoding historical vehicular behavior into hidden states to capture the time-evolving dependencies that are essential for detecting gradual attacks such as prolonged Sybil impersonation. Building on this temporal foundation, the attention mechanism refines the LSTM outputs by dynamically weighting the time steps to highlight the critical anomalies that may be obscured in standard LSTM outputs, thereby enhancing the detection of stealthy attacks in vehicular networks. Finally, the autoencoder module compresses the attention-weighted features and reconstructs the original input sequences, with a reconstruction error used to identify deviations from the normal behavior. This unsupervised framework enables the detection of Sybil attacks without relying on labeled attack data; this is critical in dynamic vehicular environments where attack patterns evolve rapidly.
The integration of the LSTM, attention, and autoencoder components introduces several technical challenges that require targeted solutions. The LSTM encoder outputs high-dimensional hidden states that increase the computational cost of the attention weight calculation and can hinder the real-time performance in vehicular network applications. To resolve this, we introduce stacked dense layers after the attention layer to reduce the dimensionality and extract deep features, ensuring efficiency while preserving the critical temporal and attention information essential for accurate anomaly detection.
In addition, the random initialization of attention weights often leads to unstable training and slow convergence because the model struggles to learn meaningful weight distributions early in the training. This issue is addressed by adopting Xavier initialization to balance the variance in the forward and backward passes, combined with dropout regularization to prevent overfitting, resulting in faster convergence and improved generalization to unseen data.
Finally, the reconstruction loss of the autoencoder and the temporal loss of the LSTM exhibit inherent trade-offs because overemphasizing one can degrade the performance of the other. A multi-task loss function with a tunable weight \(\lambda = 0.7\) is implemented to balance both objectives, ensuring the model preserves temporal dependencies while maintaining a high reconstruction accuracy.
Here, \(\mathcal{L}_{\text{recon}}\) denotes the reconstruction loss (mean squared error between the original input and decoder output), \(\mathcal{L}_{\text{temporal}}\) represents the temporal loss (mean squared error between the hidden states of the LSTM encoder and decoder), and \(\lambda\) is a hyperparameter that controls the trade-off between the two loss components. This loss function is integrated into the training pipeline outlined in Algorithm 1 to ensure that the model learns to accurately reconstruct input sequences and preserve temporal dependencies that are critical for detecting anomalies in vehicular time-series data.
3.4. Algorithm Implementation and Post-Processing
The complete LSTM–AttnAE algorithm is detailed in Algorithm 1, encompassing encoding, attention weighting, decoding, and reconstruction error calculation. Batch normalization layers are integrated post-encoder and post-decoder to stabilize the training, whereas dropout layers prevent overfitting. The model is trained to minimize the multi-task loss function, with the reconstruction errors serving as discriminative features for anomaly detection.
Following the reconstruction error computation, an SVM classifier is employed to perform the final anomaly classification. The SVM is trained on the reconstruction errors from the validation set, learning a decision boundary to distinguish between normal and anomalous behaviors. This hybrid approach leverages the strength of LSTM–AttnAE in unsupervised feature learning and reconstruction, whereas the SVM provides a robust and interpretable classification step to validate anomalies.
4. Evaluation
This section presents the experimental setup, evaluation metrics, experimental results, ablation analysis, and further analysis of the proposed model.
4.1. Experimental Setup
Table 1. Performance and convergence characteristics for different hyperparameter combinations.
Before model training, \(z\)-score normalization was applied to rescale the original input data. To ensure the reproducibility of the experiments and the optimal performance of the model, systematic hyperparameter optimization was implemented via a grid search combined with three-fold cross-validation. We evaluated the candidate sets of hidden layer numbers {1,2,3}, hidden layer dimensions {32,64,128}, learning rates {1e-4,5e-4,1e-3,5e-3,1e-2}, batch sizes {16,32,64}, and regularization strategies including dropout values ranging from 0.1 to 0.5 and L2 regularization values ranging from 1e-4 to 1e-2. The quantitative results of performance and convergence characteristics for different hyperparameter combinations are presented in Table 1. Although the 128-hidden-dimension configuration yielded a slightly higher F1-score of 0.982, it required more training epochs and incurred greater computational overhead. By contrast, the 64-hidden-dimension setup achieved a strong F1-score of 0.980 with faster convergence and lower computational cost. The optimal configuration was determined as follows: the LSTM encoder was configured with two hidden layers, each with 64 hidden states; the batch size was set to 32; the dropout value was 0.2; and the learning rate of the Adam optimizer was set to 1e-3.
Based on the optimal configuration, an attention mechanism layer with consistent input and output dimensions of 64 was constructed following the LSTM encoder that extracted high-value feature information through weighted feature summation. Then, a fully connected layer with an input dimension of 64 and an output dimension of 128 was introduced that further enhanced the feature extraction and representation capabilities of the model via high-dimensional mapping. The Tanh activation function was adopted for model training, and the Adam optimizer with a learning rate of 1e-3 was used to minimize the mean squared error between the predicted and actual values. The total number of training epochs was set to 100. All experiments were conducted based on the PyTorch framework for model training and performance evaluation.
4.2. Evaluation Metrics
Several evaluation metrics have been introduced to study binary classification problems. In this study, four commonly used metrics were considered: precision, recall, F1-score, and ROC curve. The first three measures are expressed by Eqs. (12)–(14).
4.3. Experimental Results
Table 2. LSTM–AttnAE performance on Sybil attack detection: five individual attack types and the merged dataset (VeReMi extended dataset).
To evaluate the performance of the LSTM–AttnAE model in detecting Sybil attacks in VANETs, we conducted evaluations not only on individual attack types across five categories within the VeReMi extended dataset but also on a combined dataset integrating all five attack types.
As presented in Table 2, the model demonstrated an exceptional performance with high precision, recall rates, F1-scores, and AUC values approaching or exceeding 0.97 when identifying specific attack types. These performance differences stemmed from the distinct anomaly salience of each attack pattern. Type-4 (random position attack) exhibited the highest detection accuracy owing to its frequent extreme spatiotemporal discontinuities that made the anomalies most salient. By contrast, Type-1 (constant position attack) showed a slightly lower performance because its fixed signals lacked high-frequency random jumps. Type-2, Type-8, and Type-16 attacks retained partial normal spatiotemporal correlations, leading to more subtle anomalies. The integration of the attention mechanism still enabled the model to better detect these covert attacks, resulting in a relatively strong performance. Furthermore, the model maintained robust performance even when processing comprehensive datasets containing all attack types, consistently delivering high precision, recall rates, F1-scores, and AUC values that highlighted its generalization capability and robustness across diverse datasets.
As shown in Fig. 5, the model demonstrated a higher precision for Type-4 random-position Sybil attacks and a better recall rate for Type-1 fixed-position Sybil attacks among the five attack types. This was because Type-4 and Type-1 attacks exhibited greater positional data discrepancies than the normal vehicles that the attention mechanism could more easily detect.

Fig. 5. Performance of the model on five attack types on the VeReMi extended dataset.
Comparative analyses were conducted with baseline methods, including random forest, decision tree, AdaBoost, and KNN. All the methods were trained and tested for five rounds, and random errors were minimized by averaging the results. To further verify the performance advantages of the LSTM–AttnAE model, the comparison was extended to two classical Sybil attack detection methods for VANETs, namely, the RSSI-based and social network-based (SN-based) detection methods, and detection latency was added as a key efficiency evaluation index for real-time VANET scenarios.
Table 3. Performance comparison of the LSTM–AttnAE model with six baseline models.
As presented in Table 3, the proposed LSTM–AttnAE model significantly outperformed all the comparison methods in four core indicators, namely precision, recall, F1-score, and AUC, with both precision and AUC reaching 0.99. The traditional KNN-based detection method showed low precision and recall, with recall of only 0.80, complicating the effective identification of Sybil attack behaviors. Although the decision tree and AdaBoost models showed certain improvements in the detection performance, they still had evident detection shortcomings when faced with complex attack patterns and dynamic data noise. The random forest model had a relatively better detection performance, with a precision of 0.92 and an AUC of 0.96; however, it could not effectively focus on key abnormal features in diverse attack scenarios, leaving room for improvement in the detection effect. The results of this extended comparison showed that the RSSI-based detection method had an unstable detection performance owing to signal fluctuations, whereas the SN-based detection method had a high computational overhead that limited the detection efficiency. By contrast, the LSTM-AttnAE model realized dual optimization of detection performance and efficiency while maintaining high detection precision, with an F1-score of 0.99 and average detection latency of only 12.3 ms. This was the only comparison method that achieved both high precision and low latency.

Fig. 6. Detection latency comparison of different methods on the VeReMi extended dataset.
As shown in Fig. 6, evident differences existed in the detection latencies of the different detection methods that were determined by the core computing logic and architectural design of each method. The SN-based detection method required to construct and maintain the social relation graph between vehicles in real time, involving complex graph structure calculations and information propagation mechanisms, with the largest computational overhead. Its average detection latency reached 32.6 ms that was the highest among all the compared methods. KNN was a computation-intensive detection method. In the model inference stage, all samples in the training set had to be traversed, and the distance between the samples had to be calculated, resulting in a long detection time and an average detection latency of 24.5 ms. The random forest model was constructed by integrating multiple decision trees. In inference, the output results of all decision trees had to be synthesized to complete the final judgment, and the amount of computation was significantly higher than that of a single decision tree. Therefore, its average detection latency was 18.7 ms that was higher than 14.1 ms of the decision tree model. The RSSI-based detection method completed the attack judgment only through the signal strength threshold, with the simplest computing logic and an average detection latency of 9.8 ms that was the lowest among all the compared methods. However, the detection precision of this method was also the worst among all the compared methods, with evident performance shortcomings.
The LSTM–AttnAE model achieved low detection latency mainly owing to its lightweight hybrid architectural design. The LSTM encoder of the model adopted a lightweight structure with two layers and 64 units that could efficiently extract the temporal features of the vehicle position, avoid the computational redundancy caused by deep networks, and significantly reduce the computational overhead in the feature extraction stage. The attention mechanism introduced in the model performed dynamic weighted calculations on only key abnormal features such as the position jump amplitude and identity switching frequency, without complex processing on all the features. To effectively improve the detection precision of the model, no additional computational burden was introduced. This architectural design enabled the model to quickly process vehicle position sequence data that not only met the core requirements of the VANET for the real-time performance of the detection model, but also ensured the high detection precision of the model, adapting to the dynamic and complex application scenarios of the VANET.
4.4. Ablation Analysis

Fig. 7. Performance of the proposed model on the VeReMi extended dataset.

Fig. 8. Performance of the proposed model on the Car-Hacking dataset.
The experimental results demonstrated that the proposed LSTM–AttnAE anomaly detection hybrid model outperformed traditional methods across multiple public datasets. Figs. 7 and 8 present the key performance metrics (including the precision, recall rate, F1-score, and AUC) of the model on both the VeReMi extended dataset and another public dataset, the Car-Hacking dataset, compared with conventional LSTM-based detection methods, autoencoder models, and LSTM-autoencoder models without attention mechanism integration.
The ablation study demonstrated that integrating the attention mechanism improved the F1-score from 0.96 to 0.99. This improvement stemmed from two key advantages. (1) The attention mechanism dynamically weighted high-dimensional temporal features extracted by the LSTM, emphasizing critical anomaly indicators such as the position jump magnitude and identity switching frequency that enhanced the focus of the model on discriminative signals. (2) The attention mechanism mitigated the long-sequence forgetting limitation of the LSTM by assigning higher weights to features at critical anomaly timestamps, enabling a more robust detection of sparse and covert anomalies and reducing false negatives in complex scenarios.
As shown in Fig. 7, the proposed model achieved a precision of 0.99 and an AUC value of 0.99 on the VeReMi extended dataset, representing 18% and 17% improvements, respectively, compared with the LSTM-based detection methods. This significant performance enhancement primarily stemmed from the dynamic weight allocation capability of the attention mechanism for key features, enabling the model to more accurately capture the anomalous characteristics of Sybil attacks. Compared with the LSTM-autoencoder model without integrated attention mechanisms, the proposed model demonstrated 8% and 6% improvements in precision and F1-score, respectively, further validating the effectiveness of the attention mechanisms in detecting complex attack patterns.
As shown in Fig. 8, the experimental results on the Car-Hacking dataset demonstrated that the proposed model achieved a precision rate of 0.98 and an AUC value of 0.99, significantly outperforming the comparison methods. Notably, the F1-score metric showed a 6% improvement over the LSTM-autoencoder model without attention mechanism integration. These findings indicated that the attention mechanism exhibited strong adaptability and generalization capabilities across various datasets and attack scenarios.
5. Conclusion
This study proposed a hybrid LSTM–AttnAE anomaly detection model that integrated the LSTM-autoencoder with an attention mechanism and addressed critical challenges in the VANET security, specifically, the difficulty of detecting stealthy Sybil attacks with position jumps and frequent identity switches that traditional methods often failed to handle. Ablation experiments on both VeReMi and Car-Hacking datasets confirmed the effectiveness of the attention mechanism; by dynamically weighting high-dimensional temporal features and mitigating long-sequence forgetting of LSTM, it boosted the F1-score from 0.96 to 0.99, enabling robust detection of these subtle attack patterns.
On the VeReMi dataset, this study showed that the LSTM–AttnAE method outperformed six baseline methods (random forest, decision tree, AdaBoost, KNN, RSSI-based, and SN-based detection), achieving 0.99 precision, 0.98 recall, 0.99 F1-score, and 0.99 AUC. It also delivered a unique balance between performance and efficiency, with an average detection latency of 12.3 ms that was lower than those of random forest (18.7 ms), KNN (24.5 ms), and SN-based methods (32.6 ms), and only marginally higher than that of the lightweight RSSI-based approach (9.8 ms). Therefore, this was the only method to achieve both high precision and low latency, and it satisfied the real-time demands of dynamic VANET environments.
This study advances VANET security by providing a robust, real-time solution for detecting stealthy Sybil attacks and overcoming the limitations of prior methods in terms of accuracy and latency. Future research will focus on optimizing the lightweight design of the attention mechanism and integrating edge computing to further reduce the computational overhead, thereby enhancing the practical deployment of the model in large-scale, heterogeneous VANET scenarios.
Acknowledgments
This work was supported by the Science and Technology Development Plan Project of Jilin Province of China under Grant No.20250203117SF.
- [1] H. Hadri et al., “Sybil attack detection in vehicular ad hoc networks (VANETs): A comprehensive survey,” Innovations in Systems and Software Engineering, Vol.21, pp. 453-474, 2025. https://doi.org/10.1007/s11334-025-00603-7
- [2] J. R. Douceur, “The Sybil attack,” Int. Workshop on Peer-to-Peer Systems, pp. 251-260, 2002. https://doi.org/10.1007/3-540-45748-8_24
- [3] M. S. Bouassida et al., “Sybil nodes detection based on received signal strength variations within VANET,” Int. J. Netw. Secur., Vol.9, No.1, pp. 22-33, 2009.
- [4] B. Yu et al., “Detecting Sybil attacks in VANETs,” J. Parallel Distrib. Comput., Vol.73, No.6, pp. 746-756, 2013. https://doi.org/10.1016/j.jpdc.2013.02.001
- [5] J. Grover et al., “A Sybil attack detection approach using neighboring vehicles in VANET,” Proc. of the 4th Int. Conf. on Security of Information and Networks, pp. 151-158, 2011. https://doi.org/10.1145/2070425.2070450
- [6] X. Feng and J. Tang, “Obfuscated RSUs vector based signature scheme for detecting conspiracy Sybil attack in VANETs,” Mob. Inf. Syst., Vol.2017, No.1, Article No.4682538, 2017. https://doi.org/10.1155/2017/4682538
- [7] S. S. Sefati and S. G. Tabrizi, “Detecting Sybil attack in vehicular ad-hoc networks (VANETs) by using fitness function, signal strength index and throughput,” Wirel. Pers. Commun., Vol.123, No.3, pp. 2699-2719, 2022. https://doi.org/10.1007/s11277-021-09261-x
- [8] B. Xiao et al., “Detection and localization of Sybil nodes in VANETs,” Proc. of the 2006 Workshop on Dependability Issues in Wireless Ad Hoc Networks and Sensor Networks, 2006. https://doi.org/10.1145/1160972.1160974
- [9] W. Li and D. Zhang, “RSSI sequence and vehicle driving matrix based Sybil nodes detection in VANET,” 2019 IEEE 11th Int. Conf. on Communication Software and Networks (ICCSN), pp. 763-767, 2019. https://doi.org/10.1109/ICCSN.2019.8905261
- [10] Y. Yao et al., “Voiceprint: A novel Sybil attack detection method based on RSSI for VANETs,” 2017 47th Annual IEEE/IFIP Int. Conf. on Dependable Systems and Networks (DSN), pp. 591-602, 2017. https://doi.org/10.1109/DSN.2017.10
- [11] Y. Yao et al., “Multi-channel based Sybil attack detection in vehicular ad hoc networks using RSSI,” IEEE Trans. Mob. Comput., Vol.18, No.2, pp. 362-375, 2018. https://doi.org/10.1109/TMC.2018.2833849
- [12] Y. Yao et al., “Power control identification: A novel Sybil attack detection scheme in VANETs using RSSI,” IEEE J. Sel. Areas Commun., Vol.37, No.11, pp. 2588-2602, 2019. https://doi.org/10.1109/JSAC.2019.2933888
- [13] S. Rakhi and K. R. Shobha, “LCSS based Sybil attack detection and avoidance in clustered vehicular networks,” IEEE Access, Vol.11, pp. 75179-75190, 2023. https://doi.org/10.1109/ACCESS.2023.3294469
- [14] R. V. Saraswathi et al., “Support vector based regression model to detect Sybil attacks in WSN,” Int. J. Adv. Trends Comput. Sci. Eng., Vol.9, No.3, pp. 4090-4096, 2020. https://doi.org/10.30534/ijatcse/2020/236932020
- [15] S. Ercan et al., “Misbehavior detection for position falsification attacks in VANETs using machine learning,” IEEE Access, Vol.10, pp. 1893-1904, 2021. https://doi.org/10.1109/ACCESS.2021.3136706
- [16] C. H. O. Quevedo et al., “An intelligent mechanism for Sybil attacks detection in VANETs,” 2020 IEEE Int. Conf. on Communications (ICC), 2020. https://doi.org/10.1109/ICC40277.2020.9149371
- [17] S. Azam et al., “Collaborative learning based Sybil attack detection in vehicular ad-hoc networks (VANETs),” Sensors, Vol.22, No.18, Article No.6934, 2022. https://doi.org/10.3390/s22186934
- [18] E. Abdelkreem et al., “Feature engineering impact on position falsification attacks detection in vehicular ad-hoc network,” Int. J. Inf. Secur., Vol.23, No.3, pp. 1939-1961, 2024. https://doi.org/10.1007/s10207-024-00830-2
- [19] D. E. Laouiti et al., “Sybil attack detection in VANETs using an AdaBoost classifier,” 2022 Int. Wireless Communications and Mobile Computing (IWCMC), pp. 217-222, 2022. https://doi.org/10.1109/IWCMC55113.2022.9824974
- [20] S. Rethinavalli and R. Gopinath, “Classification approach based Sybil node detection in mobile ad hoc networks,” Int. J. Adv. Res. Eng. Technol., Vol.11, No.12, pp. 3348-3356, 2020.
- [21] M. Al-Qurishi et al., “A prediction system of Sybil attack in social network using deep-regression model,” Future Gener. Comput. Syst., Vol.87, pp. 743-753, 2018. https://doi.org/10.1016/j.future.2017.08.030
- [22] A. Balaram et al., “Highly accurate Sybil attack detection in vanet using extreme learning machine with preserved location,” Wirel. Netw., Vol.29, No.8, pp. 3435-3443, 2023. https://doi.org/10.1007/s11276-023-03399-1
- [23] J. Kamel et al., “A misbehavior authority system for Sybil attack detection in C-ITS,” 2019 IEEE 10th Annual Ubiquitous Computing, Electronics Mobile Communication Conference (UEMCON), pp. 1117-1123, 2019. https://doi.org/10.1109/UEMCON47517.2019.8993045
- [24] N. C. Velayudhan et al., “An optimisation driven deep residual network for Sybil attack detection with reputation and trust-based misbehaviour detection in VANET,” J. Exp. Theor. Artif. Intell., Vol.36, No.5, pp. 721-744, 2024. https://doi.org/10.1080/0952813X.2022.2104387
- [25] Y. Rajendra, V. Subramanian, and S. K. Shukla, “Sybil attack detection in ultra-dense VANETs using verifiable delay functions,” Peer-to-Peer Networking and Applications, Vol.17, No.3, pp. 1645-1666, 2024. https://doi.org/10.1007/s12083-024-01673-3
- [26] Y. Chen et al., “MDFD: A multi-source data fusion detection framework for Sybil attack detection in VANETs,” Computer Networks, Vol.224, Article No.109608, 2023. https://doi.org/10.1016/j.comnet.2023.109608
- [27] R. Sultana et al., “Detecting Sybil attacks in VANET: Exploring feature diversity and deep learning algorithms with insights into Sybil node associations,” J. of Network and Systems Management, Vol.32, Article No.51, 2024. https://doi.org/10.1007/s10922-024-09827-7
- [28] T. Gao et al., “A content-based method for Sybil detection in online social networks via deep learning,” IEEE Access, Vol.8, pp. 38753-38666, 2020. https://doi.org/10.1109/ACCESS.2020.2975877
- [29] Y. Zhong et al., “Sybil attack detection in VANETs: An LSTM-based BiGAN approach,” 2023 Int. Conf. on Data Security and Privacy Protection (DSPP), pp. 113-120, 2023. https://doi.org/10.1109/DSPP58763.2023.10404993
- [30] U. Michelucci, “An introduction to autoencoders,” arXiv:2201.03898, 2022. https://doi.org/10.48550/arXiv.2201.03898
- [31] D. Tang et al., “A deep learning approach to detecting multiple types of Sybil nodes in VANETs,” Proc. of the 18th IEEE/ACM Int. Conf. on Utility and Cloud Computing (UCC), 2025. https://doi.org/10.1145/3773274.3774695
- [32] D. Bahdanau et al., “Neural machine translation by jointly learning to align and translate,” arXiv:1409.0473, 2014. https://doi.org/10.48550/arXiv.1409.0473
- [33] Y. Zhang et al., “Attention is all you need: Utilizing attention in AI-enabled drug discovery,” Brief. Bioinform., Vol.25, No.1, Article No.bbad467, 2024. https://doi.org/10.1093/bib/bbad467
- [34] Y. T. Gebrezgiher, S. R. Jeremiah, S. Gritzalis, and J. H. Park, “VAE-based real-time anomaly detection approach for enhanced V2X communication security,” Applied Sciences, Vol.15, No.12, Article No.6739, 2025. https://doi.org/10.3390/app15126739
- [35] M. Said Elsayed et al., “Network anomaly detection using LSTM based autoencoder,” Proc. of the 16th ACM Symp. on QoS and Security for Wireless and Mobile Networks, pp. 37-45, 2020. https://dl.acm.org/doi/10.1145/3416013.3426457
This article is published under a Creative Commons Attribution-NoDerivatives 4.0 Internationa License.


