问题
I am working with Python, scikit-learn and keras. I have 3000 thousands images of front-faced watches like the following ones: Watch_1, Watch_2, Watch_3.
I like to write program which receives as an input a photo of a real watch which maybe taken under less ideal conditions than the photos above (different background colour, darker lightning etc) and find the most similar watches among the 3000 ones to it. By similarity I mean that if I give as an input a photo of a round, brown watch with thin lace then I expect as an output watches of round shape, of dark colour and with thin lace.
What is the most efficient machine learning algorithm to do this?
For example, by following this link I have two different solutions in my mind:
1) Using a CNN as a feature extractor and compare the distances between the these features for every pair of images with reference to the input image.
2) Using two CNNs in a Siamese Neural Network to compare the images.
Are these two options the best ones for this task or would you suggest something else?
Do you know any pre-trained neural network (with pre-determined hyperparameters) for this task?
I have found some interesting posts on StackOverflow about this but they are pretty old: Post_1, Post_2, Post_3.
回答1:
It's going to be difficult to define what exactly you mean by similar with your photos. Since they are all watches you'll have to decide which features being most similar matter to you (shape, color, numbers/blank face etc.)
Here is an approach using the tensorflow library mixed with a nearest neighbor library with example code: http://douglasduhaime.com/posts/identifying-similar-images-with-tensorflow.html
It can at least get you started.
来源:https://stackoverflow.com/questions/48770065/find-most-similar-images-by-using-neural-networks