Suppose we have a training set of 3 classes of image: 1.Cats, 2.Dogs, 3.Neither cats nor dogs. We're only really bothered about detecting whether an image is a cat/dog, or neither, but we don't care whether it's a cat or a dog, just that it's one of the two.

Is it inherently "better" to train a binary class CNN by merging the Dog and Cat classes into a single "positive" class rather than train a 3-class CNN?

If it is, does it then follow that if we did care about whether the image was a dog or cat, it would also be better to first run the binary classifier to decide if it was a dog/cat or not, then run a second binary classifier trained on just cats and dogs to decide which of the two it actually is?


1 Answer 1


I would train one classifier with 3 classes:

cat, dog, neither

Use cross entropy as your cost function.

There are many examples of this online. If you Google MNIST neural network you'll find many simple examples. Or you can take one of Google's trained networks and retrain the last layer.

Here is a convolutional being trained on the Cifar set of images.

Using a pre-trained network to tell two house cats apart.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.