NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Classification from Triplet Comparison Data

Zhenghang Cui, Nontawat Charoenphakdee, Issei Sato, Masashi Sugiyama · DOI

TL;DR

This paper proves that it is possible to train a binary classifier using only triplet comparison data (e.g., "Instance A is more similar to B than to C") without ever seeing a single class label. The authors propose a novel unbiased risk estimator that allows standard machine learning models, including deep neural networks, to learn directly from these relative comparisons with theoretical guarantees of consistency.

What Problem Does This Paper Address?

In traditional supervised learning, we require absolute labels (e.g., "this image is a cat"). However, humans are often much better at making relative judgments ("these two images look more alike than that one") than assigning absolute scores or categories. This is why triplet comparisons—$(x_a, x_b, x_c)$ meaning $x_a$ is more similar to $x_b$ than to $x_c$—are popular in crowdsourcing and metric learning.

The gap in the literature was a fundamental one: Can we learn a classifier using only these triplets?

Previous approaches either used triplets for "ordinal embedding" (just mapping points to a space) or required a small set of labeled data to "anchor" the classification. This paper tackles the "passive" setting, where we have a pre-collected pile of triplets and no labels, and asks if we can still find a decision boundary that generalizes to new, single data points.

Methods

The authors' core contribution is an Unbiased Risk Estimator. Here is the high-level logic:

  1. Data Decomposition: They model the triplet generation process. When a user says $x_a$ is more like $x_b$ than $x_c$, it implies certain combinations of hidden labels $(y_a, y_b, y_c)$ are more likely than others.
  2. Pointwise Densities: They show that from these triplets, you can effectively sample from three different "synthetic" distributions ($\tilde{p}_1, \tilde{p}_2, \tilde{p}_3$). These aren't the positive/negative distributions we want, but they are related to them.
  3. The "Inversion" Trick: Using a Moore-Penrose pseudo-inverse, they derive a mathematical formula that expresses the true classification risk (the thing we want to minimize) as a weighted combination of losses calculated over these three observable triplet-based distributions.
  4. ERM Framework: Because they have an unbiased estimator of the risk, they can plug it into the standard Empirical Risk Minimization (ERM) framework. This means you can use any loss function (like Squared loss or Hinge loss) and any model (like a CNN) and optimize it using standard tools like Adam.
  5. Class Prior Estimation: They even provide a way to estimate the class prior $\pi_+$ (the proportion of positive samples) directly from the triplet data, which is usually a required parameter for such weakly-supervised methods.

Datasets

The authors evaluated their method on several standard benchmarks, generating triplets based on the underlying true labels:

  • UCI Machine Learning Repository: Six datasets including adult, breast, diabetes, magic, phishing, and spambase.
  • Image Datasets:
    • MNIST: Handwritten digits (even vs. odd).
  • Fashion-MNIST: Clothing items (upper body clothing vs. others).
  • CIFAR-10: Object recognition (transportation vs. animals).

Key Insights and Ideas

  • Classification without Labels: The most striking insight is that the "relative" geometry of the data (who is close to whom) contains enough information to recover the "absolute" classification boundary, provided you have enough triplets.
  • Theoretical Consistency: The authors prove an estimation error bound based on Rademacher complexity. This confirms that as you collect more triplets, the learned classifier converges to the optimal one—just like it would with labeled data.
  • The 0.5 Barrier: A key theoretical finding is that the method requires the class prior $\pi_+$ to be something other than 0.5. If the classes are perfectly balanced (50/50), the relationship between triplets and labels becomes symmetric and unidentifiable.
  • Model Agnostic: Unlike previous triplet-based methods that were tied to specific algorithms (like Random Forests), this approach is a "wrapper" around the risk function, making it compatible with modern Deep Learning.

Key Results

  • Superiority over Clustering: The proposed method significantly outperformed $k$-means clustering and various metric learning baselines (like ITML and SERAPH) across almost all datasets.
  • Deep Learning Success: On complex image data like CIFAR-10 and Fashion-MNIST, the method achieved high accuracy (e.g., ~91% on Fashion-MNIST) using only 1,000 triplets, whereas baseline methods often struggled to exceed 75%.
  • Robustness: The experiments showed that even when the class prior $\pi_+$ was estimated from the data (rather than known beforehand), the classifier remained highly effective.

Limitations and Future Work

  • Binary Only: The current framework is strictly for binary classification. Extending this to multi-class problems is non-trivial because the number of possible label combinations in a triplet grows exponentially.
  • Identifiability: The model can separate the two classes, but it doesn't inherently know which one is "Positive" and which is "Negative" without a tiny bit of extra info (like knowing which class is more frequent).
  • Triplet Independence: The theory assumes triplets are generated independently, which might not hold in some active learning or sequential data collection scenarios.
  • Computational Overhead: While the risk estimator is unbiased, it involves summing several terms, which can lead to higher variance during training compared to standard supervised learning, potentially requiring more iterations to converge.

Summary updated

BibTeX
@article{cui2020classification,
  author = {Zhenghang Cui and Nontawat Charoenphakdee and Issei Sato and Masashi Sugiyama},
  title = {{Classification from Triplet Comparison Data}},
  journal = {Neural Computation},
  year = {2020},
  doi = {10.1162/neco\_a\_01262},
}
Figure