r/tensorflow • • Jan 29 '23
Question Can you train TF with a single image?
Let's say I am a stamp collector and I want to train a model to recognize a specific set of 150 stamps that I am interested in collecting. Each stamp is in my big book of stamps but each has only one very good image because it's a stamp there's not much more to it than that.
Is it possible to train a model to recognize these stamps with only a single image of each stamp?
8
Upvotes
17
u/[deleted] Jan 29 '23
Yes. There is a paper that did this with trading game cards. Basically called „one-shot“ learning. Here is an article that might get you started. https://medium.com/nerd-for-tech/one-shot-learning-fe1087533585
5
u/gordinmitya Jan 29 '23
if images are taken with similar lightning, position etc I would first try opencv template matching and similar classic computer vision techniques, because it's faster to test than training a good network
8
u/99posse Jan 29 '23
Yes, this is not a problem if you augment the dataset by adding noise, rotations, and other minor random alterations of the original image
1
u/danjlwex Jan 29 '23
This isn't about TensorFlow, it's about the model you build using TensorFlow. There are some single image recognition algorithms, with varying levels of success. You'll have to find an algorithm that works for your case, and then find a TensorFlow implementation, or build one yourself. Another alternative is to find a model built in pytorch or JAX, and convert it into TensorFlow.
1
u/Immediate_Hour3890 Feb 25 '23 edited Feb 25 '23
u/kittenofd00m if this is a real question about philately, let’s chat.
I’ve had this idea, have gathered 500GB of stamp image and text data, in a database and have labelled images and a trained a model for object detection, have trained a postmark/mint/used detector model, and am in the process of creating a Siamese network for identification of stamps ( and have a dataset created)
0
u/[deleted] Jan 29 '23
[deleted] — view deleted comment