The goal of this project is to predict whether a data packet in a Vehicular Ad Hoc Network (VANET) will successfully reach its destination. This is a binary classification task based on a dataset of simulated VANET metrics collected in urban scenarios.
The project leverages a deep learning-based neural network model to analyze the following features:
- Available Bandwidth (ABE)
- Trajectory of the vehicle (TJR)
- Number of Neighbors (NV)
- Distance to Destination (DST)
- MAC Layer Losses (LMAC)
The dataset includes 5823 samples with the following columns:
- ABE: Available bandwidth in the link.
- TJR: Trajectory of the vehicle regarding the destination.
- NV: Number of neighbors.
- DST: Distance to the destination.
- LMAC: MAC layer losses.
- OUT: Target variable (1 for successful delivery, 0 otherwise).
The dataset has been preprocessed and normalized for training and evaluation purposes.
-
Data Preprocessing
- Data is normalized to ensure uniformity across features.
- The dataset is split into training (80%) and testing (20%) sets.
-
Exploratory Data Analysis (EDA)
- Correlation heatmap to understand feature relationships.
- Distribution plots for target variable (
OUT). - Dataset preview and summary statistics.
-
Model Architecture
- A Sequential Neural Network with the following layers:
- Fully connected layers with ReLU activation:
- 256 -> 128 -> 64 -> 32 units.
- Output layer with sigmoid activation for binary classification.
- Fully connected layers with ReLU activation:
- Optimized using the Adam optimizer with a binary cross-entropy loss function.
- A Sequential Neural Network with the following layers:
-
Evaluation Metrics
- The model's performance is evaluated using the following metrics:
- Accuracy = 0.8215
- Precision = 0.7996
- Recall = 0.7870
- F1 Score = 0.7932
- A confusion matrix is plotted for visual analysis of classification results.
- The model's performance is evaluated using the following metrics:
-
Deployment
- A Streamlit application is built with two tabs:
- Explore: Displays dataset preview, EDA graphs, and model metrics.
- Predict: Allows users to input feature values and predict the packet delivery outcome.
- A Streamlit application is built with two tabs:
-
Clone the repository:
git clone https://github.com/JaiSwarup/vanet-streamlit.git cd vanet-prediction -
Install the required dependencies:
pip install -r requirements.txt
-
Train the model or use the pre-trained saved model:
- Training: Run the training script to train the neural network.
python train_model.py
- Using Pre-trained Model: Ensure
model.h5is in the working directory.
- Training: Run the training script to train the neural network.
-
Run the Streamlit app:
streamlit run app.py
Link to the original dataset - https://upcommons.upc.edu/handle/2117/353774