Learning Tversky Similarity

Javad Rahnama, Eyke Hüllermeier

Abstract

This paper presents a machine learning approach to Tversky similarity, a feature-based model from cognitive science that compares objects based on shared and distinctive attributes. Unlike traditional geometric models like Euclidean distance, the Tversky model accounts for human-like perception biases, such as asymmetry and the irrelevance of simultaneous absences. We introduce a Weighted Tversky Similarity (WTS) framework where feature weights and model parameters are learned from data using a contrastive loss function. Our results on semantic image datasets show that WTS significantly outperforms standard geometric metrics and matches the performance of deep learning baselines while maintaining interpretability.

Introduction

Measuring similarity is a fundamental task in computer vision and machine learning. Most existing systems utilize geometric models, representing objects as points in a high-dimensional space where similarity is inversely related to distance (e.g., Euclidean or Cosine distance). However, psychological research by Amos Tversky (1977) demonstrated that human similarity judgments often violate geometric axioms. For instance, humans may perceive a copy as more similar to an original than vice versa (violating symmetry) and often ignore features that are absent in both objects.

To bridge this "semantic gap," we propose a learnable version of Tversky’s feature-based similarity model. This approach moves away from spatial distance and focuses on the ratio of shared to distinctive semantic features.

Methodology

The proposed system employs a two-level architecture for determining image similarity.

Feature Extraction and Similarity Model

Images are first processed by feature extractors to produce a set of binary semantic features (e.g., "is outdoors," "has wheels"). These features form the basis for the Tversky ratio model.

Architecture of the Tversky Similarity model showing feature extraction and similarity computation.

The similarity $S_{\alpha, \beta, \mathbf{w}}(\mathbf{x}, \mathbf{y})$ is calculated as a ratio of the weighted intersection of features to the weighted union and distinctive features. The parameters $\alpha$ and $\beta$ control the impact of features present in one object but not the other, allowing the model to represent asymmetric relationships.

Learning Algorithm

The primary contribution of this work is the automated tuning of the model parameters. We define a Weighted Tversky Similarity (WTS) where each feature $i$ is assigned a weight $w_i$. We optimize the parameters $\alpha, \beta$, and $\mathbf{w}$ by minimizing a contrastive loss function, which penalizes the model for high similarity scores on dissimilar pairs and low scores on similar pairs.

Algorithm 1: The iterative learning process for optimizing parameters α, β, w.

Experimental Evaluation

We evaluated the WTS model on two datasets containing high-level semantic annotations:

  • a-Pascal-VOC2008: 4,340 images across 32 categories, each with 64 binary attributes.
  • Sun Attributes: 14,340 images across 717 categories, with 102 attributes.

In these experiments, ground truth similarity is defined by whether two images belong to the same category.

Results and Discussion

The WTS model consistently outperformed or matched sophisticated baselines. On the a-Pascal-VOC2008 dataset, WTS achieved a classification rate of 0.83, significantly higher than the 0.65 achieved by weighted Euclidean distance. On the Sun Attributes dataset, WTS reached 0.81, outperforming both weighted Euclidean (0.76) and Siamese Neural Networks (0.79).

Key advantages of this approach include:

  1. Robustness to Irrelevant Features: By focusing on present features rather than shared absences, the model is more robust than geometric distances.
  2. Interpretability: Unlike "black-box" models, the learned weights $w_i$ provide direct insight into which semantic features drive similarity.
  3. Cognitive Plausibility: The ability to learn asymmetric parameters allows the model to mimic human directional comparisons.

Conclusion

We have demonstrated that a learnable Tversky similarity model provides a powerful and interpretable alternative to geometric distance metrics. Future work will explore the use of continuous "fuzzy" features and the application of ranking-based loss functions to further improve performance in image retrieval tasks.

Summary updated

BibTeX
@inproceedings{rahnama2020learning,
  author = {Javad Rahnama and Eyke Hüllermeier},
  title = {{Learning Tversky Similarity}},
  booktitle = {IPMU},
  year = {2020},
  doi = {10.1007/978-3-030-50143-3\_21},
}
Figure