Skip to content

Artificial Intelligence based motion forecasting for vehicles

Notifications You must be signed in to change notification settings

bug-author/final-year-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

95 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Motion forecasting for vehicles

A note about file structure

  • prelude/ introductory work
  • api/ A FastAPI api for serving dataset
  • training/ code (noteboks and helper scripts) for training the model
  • clustering code for second phase i.e. optimal cluster formation

Block Diagram

unnamed (0)

Problem Statement

Vehicular networks enable vehicles to communicate with each other and with roadside infrastructure. These smart vehicles are constrained in terms of computational capacity. Task offloading is a technique to perform computation intensive tasks in a coordinated manner by sharing the task load.

We have proposed an efficient technique for task offloading to reduce average computation time and the probability of failed task computations.

In summary, this project revolves around:

  • Lack of computational capacity in smart vehicles
  • Latency issues with cloud
  • Task offloading decisions

Data Pipeline

unnamed

Data

  • Dataset is generated using the SUMO traffic simulator.
  • Different variants from the dataset are served through an API developed with FastAPI on Heroku.

Exploratory Data Analysis

Obersvations and suggestions for position data unnamed (1)

  • Vehicle positions are almost purely linear data.
  • A correlation was speculated between the positions of some vehicles in the network duing dataset generation, the EDA phase supported this speculation.
  • Positions start from 0 for each vehicle and are in the range of a continuous real interval different for each vehicle.

These observation hint towards using suitable standardization or normalization techniques since Deep Learning models work better on standardized data.

Obersvations and suggestions for speed data


unnamed (2)

unnamed (3)

  • Vehicle speeds are in in the form of a time series range.
  • Some of the vehicles have peaks when the trip is initialized, and this needs to be taken care of. This is because it is a difficult task for time series regression algorithms to predict and generalize peaks in the data, especially when there are no seasonality trends in the data and it is completely random.
  • There should be some stationarity checks applied to this time series data for getting more insights before starting the development of the model. These tests are a part of the next phase in the pipeline.

Data Preprocessing

Before applying some preprocessing techniques, some tests were performed to get detailed insights. Stationarity checks were ran on the dataset.

Observations

  • Standard deviation is constant and therefore the variance is constant which should be the case for a time series to be stationary.
  • However, some vehicles violated the condition of test statistics by having a value lesser than the critical values.

unnamed (4)

unnamed (5)

Therefore, the data failed the stationarity test and needed to be made stationary before training.

  • Lag1 Differencing was applied to the dataset to make it stationary.
  • Vector normalization was also applied to the training data

unnamed (6)


Data Splitting

  • Data is splitted as: 85% train - 15% test
  • Data is also shaped as (number_of_time_steps, number_of_features) in order for it to train on Sequential DL Models (RNN, LSTM, GRU)

Model Development

  • The models is developed using Keras
  • After comparing the several models that were developed, the model with best results (Dropout Regularized LSTM) was chosen

image

  • Architecture of chosen model

unnamed (7)


Clustering

  • The forecasts from the model are given to the clustering algorithm which figures out the optimal cluster formation for a given test vehicle and constraints.

Data Preprocessing

  • The speed values are quantized upto 3 decimal places.

Feature Engineering

Vehicle Positions were dropped from the training data because of these observations.

  • Position data is always linearly increasing while the speed data is a time series.
  • The dataset simulated by SUMO was set to output readings every one second so we can easily derive the positions after forecasting.

This decision also reduces the neural network computation since there would now be 20 features for training instead of 40 in a 20 vehicle network.


Mean Computation Time Calculation

This phase is explained in the Algorithm section.

Algorithm

image


image

Results

About

Artificial Intelligence based motion forecasting for vehicles

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published