Giter Site home page Giter Site logo

dog-cat-classifier's Introduction

Dog-Cat Classifier

By Arda Mavi

Dog and cat image classifier with deep learning.

Example:

Dog: 0.92035621
Cat: 0.04618423
Cat: 0.90135497
Dog: 0.09642436
Layer outputs of test photographs:
Layer: 1
Kernel: 4
Layer: 2
Kernel: 16
Layer: 3
Kernel: 10
Look up Data/Layer_Outputs folder for other outputs.

Using Predict Command:

python3 predict.py <ImageFileName>

Model Training:

python3 train.py

Using TensorBoard:

tensorboard --logdir=Data/Checkpoints/./logs

Model Architecture:

  • Input Data Shape: 64x64x3

Layer 1:

  • Convolutional Layer 32 filter Filter shape: 3x3

  • Activation Function: ReLu

  • Max Pooling Pool shape: 2x2

Layer 2:

  • Convolutional Layer 32 filter Filter shape: 3x3

  • Activation Function: ReLu

  • Max Pooling Pool shape: 2x2

Layer 3:

  • Convolutional Layer 64 filter Filter shape: 3x3

  • Activation Function: ReLu

  • Max Pooling Pool shape: 2x2

Classification:

  • Flatten

  • Dense Size: 64

  • Activation Function: ReLu

  • Dropout Rate: 0.5

  • Dense Size: 2

  • Activation Function: Sigmoid

Optimizer: Adadelta
Loss: Binary Crossentropy

Adding new train dataset:

If you want to add new dataset to datasets, you create a directory and rename what you want to add category (like 'cat' or 'phone').

If you want to add a new training image to previously category datasets, you add a image to about category directory and if you have npy files in Data folder delete npy_train_data folder.

Note: We work on 64x64 image also if you use bigger or smaller, program will automatically return to 64x64.

Important Notes:

  • Used Python Version: 3.6.0
  • Install necessary modules with sudo pip3 install -r requirements.txt command.

dog-cat-classifier's People

Contributors

ardamavi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

dog-cat-classifier's Issues

Any JPG returns "It is a dog !"

In passing test_dog.jpg or test_cat.jpg, both return "Its a dog!". Maybe a problem on my end? Im running train.py first and then predict.py

thanks

How can I make my own npy train data?

First of all thank you for your amazing work, I'm planning to implement ur code using my own data, im wondering how can i make my own npy train data?

train.py problem

patrick@123:~/Desktop/Dog-Cat-Classifier-master$ python predict.py test_cat.jpg Using TensorFlow backend. 2019-10-25 00:19:23.323125: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 2019-10-25 00:19:23.340188: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 1992000000 Hz 2019-10-25 00:19:23.340916: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x694d4f0 executing computations on platform Host. Devices: 2019-10-25 00:19:23.340974: I tensorflow/compiler/xla/service/service.cc:175] StreamExecutor device (0): Host, Default Version [[1. 0.]] [0] It is a cat !

I have entered train.py
without removing or adding any image
but accurancy prints [[1. 0.]]
could you tell me why?
thanks.

Needs Update...

some libraries use outdated methods...

get_dataset.py needs to be corrected as:

at line 14
img = imresize(img, (img_size, img_size, 3))
must changed as
img = Image.fromarray(img).resize(size=(img_size, img_size))

add line 7:
from tensorflow.keras.utils import to_categorical
change line 47 to:
Y = to_categorical(Y)
must be added

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.