Skip to content

SRVcodxx/Animal-classification-using-CNN-VGG16-and-grad-CAM.

Repository files navigation

About Dataset

Animal-classification-using-CNN-VGG16-and-grad-CAM.

This is the dataset I have used for my matriculation thesis.

It contains about 28K medium quality animal images belonging to 10 categories: dog, cat, horse, spyder, butterfly, chicken, sheep, cow, squirrel, elephant.

I have used it to test different image recognition networks: from homemade CNNs (~80% accuracy) to Google Inception (98%). It could simulate a smart gallery for a researcher (like a biologist).

All the images have been collected from "google images" and have been checked by human. There is some erroneous data to simulate real conditions (eg. images taken by users of your app).

The main directory is divided into folders, one for each category. Image count for each category varies from 2K to 5 K units.

Model use:

CNN VGG-16

A convolutional neural network is also known as a ConvNet, which is a kind of artificial neural network. A convolutional neural network has an input layer, an output layer, and various hidden layers. VGG16 is a type of CNN (Convolutional Neural Network) that is considered to be one of the best computer vision models to date. VGG16 is object detection and classification algorithm which is able to classify 1000 images of 1000 different categories with 92.7% accuracy. It is one of the popular algorithms for image classification and is easy to use with transfer learning.

VGG-16 model layermodel architecture

gradCAM

The gradCAM function computes the importance map by taking the derivative of the reduction layer output for a given class with respect to a convolutional feature map. For classification tasks, the gradCAM function automatically selects suitable layers to compute the importance map for.

Model Checkpoint

  • Reduce the learning rate if the validation loss does not decrease after 3 successive epochs
  • Stop the training if the validation loss does not decrease after 5 successive epochs
  • Save the best model if it has a better validation loss than before

Model Architecture

Model: "model"


Layer (type) Output Shape Param

=================================================================

input_1 (InputLayer) [(None, 224, 224, 3)] 0


block1_conv1 (Conv2D) (None, 224, 224, 64) 1792


block1_conv2 (Conv2D) (None, 224, 224, 64) 36928


block1_pool (MaxPooling2D) (None, 112, 112, 64) 0


block2_conv1 (Conv2D) (None, 112, 112, 128) 73856


block2_conv2 (Conv2D) (None, 112, 112, 128) 147584


block2_pool (MaxPooling2D) (None, 56, 56, 128) 0


block3_conv1 (Conv2D) (None, 56, 56, 256) 295168


block3_conv2 (Conv2D) (None, 56, 56, 256) 590080


... Total params: 14,982,474 Trainable params: 14,982,474 Non-trainable params: 0

Model Evaluation

Test Loss: 0.13662 Test Accuracy: 96.33%

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published