Vehicle Classification has emerged as an important field of study because of its importance in traffic management, surveillance, security systems, etc. GPS enabled location trackers can store the location history of terrestrial vehicles via satellite. This data can further be used for various analytical purposes. One such purpose is determining the class of vehicles.
The prime objective of this project is to determine, as accurately as possible, the class of vehicles in the given dataset through various machine learning techniques.
Directory structure [Index]
.
├── GPS_Vehicular_Classification.ipynb
├── README.md
├── ReadMe.pdf
└── Vehicle_Classification_using_GPS_Data.pdf
- GPS_Vehicular_Classification.ipynb contains the complete code which is divided into following four sections:
- Mounting necessary files: Run this code to have the environment set up with all the necessary files.
- Importing necessary prerequisites: Run this piece of code to import the necessary libraries and download the dependencies.
- Preprocessing: Run this piece of code preprocess the data. Please refer to the code for block-by-block details. Also, please note that ceratin changes to the names of the files may be required as per the situation.
- Training: Run this code for training the model on the preprocessed data. Again, please refer to the comments of the code for more details.
Tech used [Index]
- python3.8
- conda
- Jupyter notebook
Dev setup [Index]
-
Install python either from source or from PPA. Here's how to install python3.8 using PPA:
sudo apt update sudo apt install software-properties-common sudo add-apt-repository ppa:deadsnakes/ppa sudo apt update sudo apt install python3.8
Check installation by running
python3.8 --version
. You should getPython 3.8.1
as output. -
To install conda (You can also refer to SO or Conda Docs):
-
First choose the version that you would like to download by going to this. We recommend you to download the latest version. At the time of writing this readme,
Anaconda3-2020.11-Linux-x86_64.sh
is the latest version available. Now, run the following commands:wget -c https://repo.anaconda.com/archive/Anaconda3-2020.11-Linux-x86_64.sh bash Anaconda3-2020.11-Linux-x86_64.sh
Note that you can replace
Anaconda3-2020.11-Linux-x86_64.sh
with the your own choice in the above commands. -
To make the changes take effect, close and then re-open your terminal window.
-
To test your installation: in your terminal window or Anaconda Prompt, run the command
conda list
. A list of installed packages appears if it has been installed correctly.
-
-
To install jupyter lab use:
pip install jupyterlab
Python packages [Index]
The code has dependency on following python packages:
- scikit-learn (
conda install -c anaconda scikit-learn
) - xgboost (
conda install -c conda-forge xgboost
) - matplotlib (
conda install -c conda-forge matplotlib
) - glob (
sudo pip install glob2
) - keras (
conda install -c anaconda scikit-learn
) - pyproj (
conda install -c conda-forge pyproj
) - pandas (
conda install -c anaconda pandas
) - numpy (
conda install -c anaconda numpy
)
If there are any other packages which we have missed, they can also be downloaded using conda install -c anaconda <package-name>
.
How to run [Index]
The code can be run by any of the two ways:
- Using Jupyter Notebook: Press
Shift + Enter
to run the cell. Follow for each cell. - Using command line: Use
./src
command. The command will finish silently (No Prompts). We recommend to use method 1, since progress can be tracked as prompt messages are displayed by the code.
Testing and Results [Index]
We have prepared a complete document giving information of the dataset used, traning methods, testing and validation and conclusion.
Credits [Index]
I hereby acknowledge the contribution of Swadesh Vaibhav in this project.