title: machine learning: Image classification into 3 classes (Dog or Cat or Neither) using Convolutional NN
body: <p>I would appreciate a bit of help in thinking this through. I have a classifier that can categorize the images into either dog or cat successfully with good accuracy. I have a good data set to train the classifier on. So far no problem.</p>
  
  <p>I have about 20,000 dog and 20,000 cat images.</p>
  
  <p>However, when I try to present other images like a car or a building or a tiger that do not have either dog or cat, I would like the output of the classifier to be "Niether". Right now obviously, the classifier tries to classify everything into a Dog or Cat which is not correct.</p>
  
  <p>Question 1:</p>
  
  <p>How can I achieve this? Do I need to have a 3 set of images that do not contain dog or cat and train the classifier on these additional images to recognize everything else as "Neither"?</p>
  
  <p>At a high level approximately, How many images of the non Dog/Cat category would I need to get good accuracy? Would about 50,000 images do since the non dog/cat images domain is so huge? or do I need even more images?</p>
  
  <p>Question 2:</p>
  
  <p>Instead of training my own classifier using my own image data, can I use Imagenet trained VGG16 Keras model for the initial layer and add the DOG/CAT/Neither classifier on top as the Fully connected layer?</p>
  
  <p><a href="http://www.pyimagesearch.com/2016/08/10/imagenet-classification-with-python-and-keras/" rel="noreferrer">See this example to load a pre-traied imagenet model</a></p>
  
  <p>Thanks much for your help.</p>