How do I detect similar objects in an image?
Disclaimer: I have never used Siamese networks

I would approach this problem in two steps:

First: train object detector and train it for eligible classes of object, for example using Yolo architecture.

You could use pretrained object detector and finetune it for your classes of objects.

Second: extract a lot of bounding boxes of eligible objects of the same classes from your dataset and train Siamese network on their subimages.

Siamese network output similarity measure between two objects.

Your pipleline would look like:


Run object detetctor
For each two pair of objects of the same class rescale bounding boxes and run Siamese network.
Check if the similarity distance between two objects is less then threshold (tunable hyperparameter)