Learn practical skills, build real-world projects, and advance your career

Car Classification using Pytorch

Steps for the Analysis:

  1. Find a dataset online (either download and existing dataset or create one from web scraping, Google images, etc.)
  2. Understand and describe the modeling objective clearly like:
    • What type of data is it? (images, text, audio, etc.)
    • What type of problem is it? (regression, classification, generative modeling, etc.)
  3. Exploratory Data Analysis- explore the data set and answer any questions you might have
  4. Modeling - try 4-5 approaches:
    Define a model (network architecture)
    Pick some hyperparameters
    Train the model
    Make predictions on samples
    Evaluate on test dataset
    Save the model weights
    Record the metrics
  5. Conclusions - summarize your learning & identify opportunities for future work

Step1

Finding a Dataset

After doing a proper research I decided to work on the Car Classification Problem and In this Project, I'll be using the (Standford's Cars Dataset)[https://ai.stanford.edu/~jkrause/cars/car_dataset.html]

Why this Topic for Classification?

Being an avid Car lover, I'm always very Inquisitive about finding the Models and the types of car which I usually see so I decided to try that little brain experiment through the Artificial brain, which is the Neural Network with the knowledge I gained in this Course.

Step2

Modelling Objective

What type of Dataset is it?

The Cars Dataset contains mainly of 16,185 images of 196 classes of cars. The data is split into 8,144 training images and 8,041 testing images, where each class has been split roughly in a 50-50 split. Classes are typically at the level of Make, Model, Year, e.g. 2012 Tesla Model S or 2012 BMW M3 coupe.

#Installing Jovian 
!pip install jovian --upgrade --quiet
#Importing all the modules required 

import os
import torch
import torchvision
import torch.nn as nn
import torch.nn.functional as F
from torchvision import transforms
import torchvision.models as models
from torchvision.datasets.utils import download_url
from torch.utils.data import DataLoader, Dataset
import torchvision.transforms as tt
from torch.utils.data import random_split
import numpy as np
import pandas as pd
import jovian
import tarfile
from PIL import Image
import matplotlib.pyplot as plt
%matplotlib inline
from scipy.io import loadmat
from skimage import io
from tqdm import tqdm
import time
from IPython.display import display