Project 11
Perform the training on a dataset with one of the object detection models of Tensorflow API
The TensorFlow Object Detection API was used to train an older pre-trained model. The Steps involved in the process are explained below:
1. Dataset Selection, Pre-processing, and aggregation
A publicly available dataset was used for the purpose. Multiple potential datasets were considered and the Vehicles OpenImage Dataset(Vehicle OpenImage Dataset from Roboflow) was chosen for the training purpose. It has 627 images with annotations as bounding boxes and the dataset is separated into train, test and validation containing 439, 125, and 63 images respectively. The dataset was chosen because of the wide variety of download options. Roboflow also has the option to download the dataset in .tfrecord format, which Tensorflow Object Detection uses internally.
2. Setting up the Drive folders and Colab Notebook
A google Colab Notebook was used to perform the training of the model and the Inference from the model. A folder called TensorFlow was created and the various subdirectories were set up. A pre-trained model called SSD Resnet50 V1 FPN 640X640 was used. The model was downloaded from the TensorFlow model zoo. The pipeline configurations were modified according to the requirements of the training. The Colab Notebook attached below was used to train the model with the dataset.
Drive link - https://drive.google.com/drive/folders/1IBT_DZviyNMA0-H-jk-nji9xzFJd06Fr?usp=share_link
Colab Link - https://colab.research.google.com/drive/1MCzUvfpCHxANRbAI3gxtntonoREe5ygA?usp=share_link
Object Detectors
Object detection is a technique used to identify and recognise certain classes of objects in an image or a video feed. In this particular case, the model was tuned particularly to detect vehicles. 5 classes of vehicles such as cars, buses, ambulances, motorcycles, and trucks were annotated in the dataset. The model was trained for approximately 3 hours and the loss function associated with the model was reduced to 0.39.
Object detection can be done in multiple ways such as two-stage detections which use RPN(region proposal networks) to identify sub-parts of the image that might contain an object of interest. The second stage classifies the sub-part of the image for object identification. In the case of single-stage as opposed to Two-stage Detection algorithms, are generally faster but come at the loss of accuracy.
Evaluation
The TensorBoard module was used to evaluate the model performance and loss function analysis. The outputs for the same are attached below:


Inference
The trained model was exported and the model was used to derive inference from another image that was passed to the model. The Image was not part of the dataset and the model was able to detect the objects to a satisfactory level.
The Input Image is attached below:

The Output of the model is attached below:
