Can we train Yes vs No in the same way as cat vs dog

If I want to teach of existing cat on the picture, can I use the same way to do it?

Like if I want to know is there any cat on the picture or not?

Thank you

To train a “cat” vs “not-cat” classifier, I think you will want to have a classifier with binary cross entropy as loss function, then you simply apply a threshold to measure the “catness”. It is hard to generalize a “non-cat” pictures, as it could be literally anything (depends on your dataset though).

I’m not sure I understand, what does it mean :slight_smile:

yes you can do it.But i am afraid that this wont be a non linear problem and what is the output you want.Can you please elaborate a bit more.

prediction should say how possible is that cat is on the picture.

if it is dog is on the picture it should say 0, if it is human is on the picture it should say 0, if it is mountains are on the picture it should say 0, but if it is cat is on the picture - it should say 1

something like this

I think you should run lesson1.ipynb and then use that model to test pics and u will get what u r saying.

should I use it with only one class - cats?

no either with cats vs dogs
or with cats vs pictures with noncats(you have to create this dataset)(watch haarcascade video on youtube you will be able to get how to create a dataset)