0
$\begingroup$

If I have only 1 image for each of 10 classes, what is the best way to build an image classifier? The images themselves are large (1200x1600) and of good quality. For example:

enter image description here

Or similar images from https://www.pexels.com/search/flowers/

From what I have read, neural networks need large amount of data for training. Which other machine learning methods can be used in such a situation? Basically, image similarity needs to be assessed. Can support vector machines be used here?

$\endgroup$
6
  • $\begingroup$ Maybe try KNN but it’s hard to answer without more details about the data set and the objective of this classification. $\endgroup$
    – Juju
    Oct 7 '18 at 3:47
  • $\begingroup$ What more details do you need? $\endgroup$
    – rnso
    Oct 7 '18 at 3:48
  • 1
    $\begingroup$ The set of images and labels. And why only one image per class? It is a theoretical question? In this case it should be easy to get more images and use transfer learning from a pre-trained CNN for example. $\endgroup$
    – Juju
    Oct 7 '18 at 3:58
  • $\begingroup$ Welcome to stackoverflow. You should try to answer the question rather than questioning the question! For the given situation, do you know of any method that can be applied? If knn is the answer, you should give more details about it. Otherwise, your answer is more like a comment and is likely to be down voted. $\endgroup$
    – rnso
    Oct 7 '18 at 4:07
  • $\begingroup$ How will you test the model accuracy if you do not have the test data? $\endgroup$
    – Bhakti
    Aug 27 '19 at 11:28
3
$\begingroup$

One image per class in way too less data for building any classifier. Rather than image classification, image similarity matching seems a better approach and so I would suggest you a Siamese network for one-shot learning.

A Siamese network is a class of neural network that contains two or more identical network and are used to differentiate between the input images by maximizing the minimum distance among the images. This technique is helpful for what we call as One-shot learning.

But if you only want to build a classifier, here are a few steps you can think about:

  1. Try to increase your dataset size by adding a few more images to you training set.
  2. Apply heavy Image-augmentation.
  3. Use a Pre-trained model to try transfer learning.
$\endgroup$
2
$\begingroup$

I would try to use transfer learning. Download a pre-trained model, test it on your data, if the accuracy is insufficient, run a fine tuning by sampling a number of random crops from each image (data augmentation) and the test it again.

https://github.com/tensorflow/models/tree/master/research/slim#pre-trained-models

$\endgroup$
1
$\begingroup$

There are several tools in python which will help you prepare the dummy data based on your data. You can increase the amount of data first and then try classification.

$\endgroup$
1
  • $\begingroup$ It will be better if you can list some of these tools and some details and/or links here. $\endgroup$
    – rnso
    Aug 29 '19 at 7:27
0
$\begingroup$

I read this article over the weekend that seems relevant to this question. It doesn't go over any code, just dataset theory and how you can include multiple classes in one image, and after a small number of images you can introduce a large number of classes. They acknowledge the difficulty in creating an accurately labeled dataset on which to train. A quote regarding the theory behind it:

“If you think about the digit 3, it kind of also looks like the digit 8 but nothing like the digit 7,” says Ilia Sucholutsky, a PhD student at Waterloo and lead author of the paper. “Soft labels try to capture these shared features. So instead of telling the machine, ‘This image is the digit 3,’ we say, ‘This image is 60% the digit 3, 30% the digit 8, and 10% the digit 0.’”

$\endgroup$

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.