Learning the similarity between objects has a dominant role in human cognitive processes and artificial systems for recognition and classification.