Skip to content

AishwaryaParaspatki/Cats-Versus-Dogs---Image-Classification-Using-CNNs

Repository files navigation

Cats Versus Dogs - Image Classification Using CNNs

This notebook consists of 3 parts:

Image Augmentation
CNN Model
VGG16 Model

Technology stack:

Python
Keras - TensorFlow
matplotlib
Numpy
piexif
shutil

The dataset for this project is hosted by Microsoft.
https://www.microsoft.com/en-us/download/details.aspx?id=54765

Notebooks:

  1. visualize.ipynb:

Cats:

Cats

Dogs: Dogs


  1. Image Augmentation:

An example on a random image from the dataset.

Augmented_Image


  1. CNN Model:
    The Hyper Parameters used:
    FILTER_SIZE = 3
    NUM_FILTERS = 32
    INPUT_SIZE = 32
    MAXPOOL_SIZE = 2
    BATCH_SIZE = 16
    STEPS_PER_EPOCH = 20000//BATCH_SIZE
    EPOCHS = 20

The CNN model layer sequence goes like:
Conv2D -> MaxPooling -> Conv2D -> MaxPooling -> Flatten -> Dense -> Dropout -> Output
with sigmoid activation for the output layer and relu activation for the rest of the layers with adam optimizer and accuracy as the evaluation metric.
Output:
loss: 0.7063166499137878
accuracy: 0.778124988079071



  1. VGG 16:
    Taking the input size of 128 with a batch size of 16 examples, I have trained the VGG16 model from keras, by freezing the pretrained layers, for 3 epoches with 200 steps per epoch using imagenet dataset's pretrained weights.

loss: 0.47205138206481934
accuracy: 0.8762500286102295

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published