Skip to content

Instantly share code, notes, and snippets.

@KaiLicht
Created October 12, 2020 20:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KaiLicht/71e0d4a3279bec77bea2c67b22012cd0 to your computer and use it in GitHub Desktop.
Save KaiLicht/71e0d4a3279bec77bea2c67b22012cd0 to your computer and use it in GitHub Desktop.

Use Keywords to create Image Classifiers

Presenter

Kai Lichtenberg - Machine Learning Engineer for Industrial Applications

LinkedIn: https://www.linkedin.com/in/kai-lichtenberg/

Context

Gathering data for image classification tasks can be a annoying hurdle. Wouldn’t it be awesome, if you could just define a keyword for each image class to create a classifier? With the google image search engine this is much more easy than you think.

Description

The KeywordImageClassfier is a fun little project that uses the google-images-download python tool and the fast.ai pytorch library to create image classifiers by just using keywords. In the example case we'll add Corn Dogs to the famous Hot-Dog-Or-No-Hot-Dog Classifier. We'll do that by just specifying the classes 'Hot Dog' and 'Corn Dog', automatically download as much pictures as you want per class from google and fine tune the last layers of a ResNet model pretrained on ImageNet.

Code

https://gist.github.com/KaiLicht/5b7692039455ec77c40a4ab8d6fb6f75

Python libraries used

fastai, PIL, google_images_download

Open questions/issues

  • How reliable is such a classifier, when you don't check the images?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment