Skip to content

Cat and Dog classifier made using fine tuning InceptionV3 (Transfer Learning)

License

Notifications You must be signed in to change notification settings

shoryasethia/Cats-Dog-InceptionV3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Cat - Dog Classifier

Clone Repo

git clone https://github.com/shoryasethia/Cats-Dog-InceptionV3
cd Cats-Dog-InceptionV3

Dataset

  • Download it from here

Transfer Learning

  • Used InceptionV3 as base model
from tensorflow.keras.applications.inception_v3 import InceptionV3

pre_trained_model = InceptionV3(input_shape = (150, 150, 3),
                                include_top = False,              
                                weights = None)           
  • Used weights of Imagnet dataset, downloaded from here
pre_trained_weights_file = 'inception_v3_weights_tf_dim_ordering_tf_kernels_notop.h5'

pre_trained_model.load_weights(pre_trained_weights_file)
  • Freezed those weights and removed/discarded last few layers
pre_trained_model.trainable = False   
  • Added following layers further
Model: "sequential_1"
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Layer (type)                    ┃ Output Shape           ┃       Param # ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ functional_2 (Functional)       │ ?                      │    18,191,008 │
├─────────────────────────────────┼────────────────────────┼───────────────┤
│ flatten_1 (Flatten)             │ ?                      │   0 (unbuilt) │
├─────────────────────────────────┼────────────────────────┼───────────────┤
│ dense_3 (Dense)                 │ ?                      │   0 (unbuilt) │
├─────────────────────────────────┼────────────────────────┼───────────────┤
│ dense_4 (Dense)                 │ ?                      │   0 (unbuilt) │
├─────────────────────────────────┼────────────────────────┼───────────────┤
│ dense_5 (Dense)                 │ ?                      │   0 (unbuilt) │
├─────────────────────────────────┼────────────────────────┼───────────────┤
│ dense_6 (Dense)                 │ ?                      │   0 (unbuilt) │
├─────────────────────────────────┼────────────────────────┼───────────────┤
│ dense_7 (Dense)                 │ ?                      │   0 (unbuilt) │
└─────────────────────────────────┴────────────────────────┴───────────────┘
 Total params: 18,191,008 (69.39 MB)
 Trainable params: 0 (0.00 B)
 Non-trainable params: 18,191,008 (69.39 MB)

Got Accuracy of 0.9575660824775696 on Test Dataset

Predictions

Download My Fine Tuned InceptionV3 Model

from tensorflow.keras import models

model = models.load_model("FineTuneInception.h5)
  • If this repo helped in any way, give it a like
  • Author : @shoryasethia

About

Cat and Dog classifier made using fine tuning InceptionV3 (Transfer Learning)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published