I'm trying to build a CNN to identify whether or not a picture contains a lion. One of my classes would obviously be filled with pictures of lions, and pictures that have lions.

What about the data I put in my not_lion class? Should I fill it with images of random things (for example, take a few images from each class in ImageNet)? Should I put in pictures of things similar to lions, like tigers, so the network better learns what a lion actually is?

My idea is to make 50% of the not_lion class pictures of tigers, pumas, etc, and 50% random stuff - I think that this would make the network learn what a lion actually is, and also ensure the network doesn't classify a laptop as a lion.


It depends on the use you are giving. The $not.lion$ class should contain sufficient data of different things, but also should contain tigers, cats, african landscapes without lions, etc.

Your idea of 50-50 is good.

Add this: The weights $w$ could help you define where your model should focus: Lesser weights when there is something easily distinguishable from a lion like a computer, but larger weights when there is an african landscape.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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