How to build an image detector?

In lesson 1, we are taught how to use resnet to train our pre-populated image dataset of cat and dog breeds. Then in the downloading images tutorial, we are taught how to obtain our custom set of images (with different labels), and train a classifier to distinguish between them.

What tweak would one need to do to be able to classify a single class of images ? For instance, I’d like to download a set of “car” images, and be able to classify cars against any other image. Is this something we can currently do, or will that become easier to understand as we move along in the course ?


Sure you can do that! :slight_smile: Simply create two folders, “car” and “not-car”. Put lots of images of things that aren’t cars in the latter folder. Then follow along with the steps from lesson 1.


If you are doing this it would be nice to hear your results. I’m not sure is there a lot of material online but I’m very curious to hear how much non-car images affect. For example, if you have 50 car images and only 1 non-car image will it do almost as well as 50 car images and 10 non-car images. So this way you could see how much adding just random non-car images help. If you add monkey picture as non-car picture in train set will it make model a lot better although there is no monkey images in test set?

This could be very interesting thing to do especially for beginners. I might even be interested about this myself so I may share some of my results here tomorrow.

1 Like

Well it took more time than I first predicted but I finally written Medium article about this. I’m not professional researcher but this was fun and educational journey for me. I recommend everyone to just test things they don’t understand or know. I hope you give me some feedback about it. Did I gave enough information and should I do something more? Well, code is in my github so if someone found something which they might want to test just clone it and modify it to your own needs. I’m currently uploading data set to Drop Box but it will be available in two to three hours on Github.


I’m surprised by some of your results. Especially the all white images and the hotdogs. Do you have the images posted somewhere? I was interested in trying to recreate that experiment.

I willl post those maybe in 10 hours. It take some time to upload those.

I’m so happy you did this. It allows us to see what kind of training examples affect the accuracy. Thanks for putting in this effort!

1 Like

Ok now you can see data set on my github. I hope you report me if you find something new that I couldn’t find.

1 Like

This was an issue that kept coming up in the RSNA Pneumonia detection Kaggle challenge. What should you do with your confusion matrix? What class of images do you need more of? Are images with the most confusion the thing you need more of?

What if there was a way you could manipulate dropout to determine which cluster of images or class of images had biggest effect on accuracy?

So you could say: “we need more of this type of image”

Thats sounds great idea. I have to think it little bit and maybe I come up something.

1 Like