Tyler Mey
Tyler Mey

Reputation: 53

Training Tensorflow to recognize a specific image

I would like to train a tensorflow model to recognize a very specific home appliance. I'm familiar with using Tensorflow to do a variety of things, but I'm unsure of the optimal way to build the dataset.

My initial thought is to supply myself with 100-200 images of the appliance from multiple angles, and then 1000 or so images of other appliances from google search that are not correct. Is there a better way than how I plan to tackle it?

I am ok with the recognition being much better from sides of the object that container more characteristics, but hope to be able to attain a high level of accuracy from the front angles.

Upvotes: 3

Views: 1422

Answers (2)

Ekaba Bisong
Ekaba Bisong

Reputation: 2982

To approach this problem, you should take advantage of transfer learning. To put it simply, transfer learning makes use of already trained or pre-trained classifiers and works on the output layer, commonly called a bottleneck to retain the model to recognize your custom images. This saves you the time and effort to build/ train an image recognition classifier from scratch.

The Google Inception V3 model is a useful starting point. With this model, lots of effort regarding engineering and training time have been put in to create a state of the art image classifier. The model was trained on the ImageNet dataset from 2012.

This excellent tutorial TensorFlow for Poets will guide you through the process of doing transfer learning on the pre-trained Inception V3 model and get the model to identify your custom images.

The size of your image set is not bad for a start, however, as a rule of thumb in training machine learning algorithms, more data often leads to higher accuracy and better generalization. This is taking into consideration that other issues that pertain to the bias-variance tradeoff are respected.

In my opinion, you do not need to do any training on negative example. Off the top of my head, I will suggest that you train with your "positive" example data set, and then set an accuracy threshold. For example, if an image cannot be recognized with an accuracy greater than say 60%, classify as "not a home appliance". You can then use your data set of negative examples and test set of positive examples to check how well your algorithm is doing. Just remember to keep aside a validation set for hyper parameter tuning.

Upvotes: 1

Sir Tesla
Sir Tesla

Reputation: 328

you can use imagenet to download the whole set of images as it gives you a collection of specific image dataset as a url, so you just have to write a code that accesses the url and dowloads the images to a specific directory.

now comes your next step of training the images. I have the code for imagenet to download images, can share if you want

Upvotes: 1

Related Questions