Lesson 1 Cats/Dogs - Train on one category

In cats vs. dogs, we train a model to detect whether a picture has a cat in it, or a dog in it.

What do we do to train a model to detect whether or not there is a cat in the picture at all?

One approach I thought of is to still have two categories: cat and notcat. The cat category will have images of cats, and the notcat category will have images of anything but cats.

I see this as problematic, because you would have to be careful with the data. For example, if notcats didn’t have any animal pictures in it at all, then you would in effect be training a model to predict between animal and notanimal, right?

What’s the correct approach in this situation?

I don’t see why you can’t already use the model to answer that question. It doesn’t really matter if it’s dogs, ships, or flowers, I think this model is already trained to identify if a picture has a cat or not in it. As for the type of images I don’t think it matters as well. As long as the model is able to discern, given any type of image, if a cat is present, then it should be ok. And it should be able to do that as it is.

Of course, if you wanted to make it more general you’d have to add more random images I guess and finetune (maybe the last layers or all) your model given the new image dataset.