Pairwise Difference Learning for Classification

Mohamed Karim Belaid, Maximilian Rabus, Eyke HüllermeierDS 2024

Introduction

Standard supervised learning paradigms typically focus on finding a direct mapping from an input feature vector $x$ to a categorical label $y$. While this approach is highly effective for large-scale datasets, it often falters in "small data" regimes where limited examples make it difficult to resolve complex, non-linear decision boundaries.

This paper introduces Pairwise Difference Learning for Classification (PDC), a meta-learning framework that shifts the focus from individual labels to the relationships between data points. By transforming a multiclass classification problem into a binary task—asking "Do these two instances belong to the same class?"—PDC provides a robust mechanism for data augmentation and uncertainty quantification, particularly when training data is scarce.

Methodology: The Dual Task Transformation

The core innovation of PDC is the "dual task" transformation. Instead of training on $N$ individual data points, the model is trained on up to $N^2$ pairs of instances.

Data Transformation and Feature Engineering

For every pair $(x_i, x_j)$ in the training set, the target becomes a binary label: $1$ if the points share the same class, and $0$ otherwise. To capture the relative patterns between instances, the joint representation of a pair includes the original features of both points concatenated with their vector difference ($x_i - x_j$). This approach effectively expands a small dataset of 100 points into a rich training set of 10,000 pairs.

The PDC training paradigm transforms a multiclass problem into a binary similarity task.

Inference and Symmetrization

During the prediction phase, a new query point $x_q$ is compared against the training set (acting as "anchors"). The model calculates a posterior probability for each class by treating each anchor as evidence and averaging the results. To ensure consistency, the framework enforces symmetry by averaging the model's predictions for $(x, x')$ and $(x', x)$.

Uncertainty Quantification

Because the final prediction is an ensemble-like average of many individual comparisons, PDC allows for sophisticated uncertainty decomposition. Using Shannon entropy, the authors decompose total uncertainty into aleatoric (inherent noise in the data) and epistemic (uncertainty stemming from a lack of model knowledge), providing deeper insights into model confidence than standard classifiers.

Experimental Evaluation

The researchers evaluated PDC across 99 diverse datasets from OpenML, focusing on small-data scenarios (37% of datasets had fewer than 600 instances). PDC was benchmarked against seven state-of-the-art Scikit-learn estimators, including RandomForest, ExtraTrees, and GradientBoosting.

Key Insights and Results

The results demonstrate that PDC significantly enhances the performance of base learners. Using ExtraTrees as a base learner, PDC achieved the highest average Macro F1 score across the nearly 100 datasets, outperforming its equivalent baseline in 75% of cases.

The "Single Tree" Power-up

One of the most striking findings is the impact on simple models. A single Decision Tree wrapped in the PDC framework often performs as well as, or better than, a standard ensemble of 100 trees (like a Random Forest). This suggests that the pairwise transformation allows simple learners to capture complex, non-linear patterns that they would otherwise miss in a classical training setup.

Decision boundary analysis comparing standard classifiers against their PDC-enhanced counterparts.

As shown in the boundary analysis, PDC-enhanced models (bottom panel) exhibit more refined and robust decision boundaries compared to their standard counterparts (top panel), particularly for non-parametric models like Decision Trees and Nearest Neighbors.

Conclusion and Future Directions

PDC represents a powerful hybrid of instance-based and model-based learning. While it offers superior generalization and reduced overfitting on small datasets, it introduces computational challenges: training scales at $O(N^2)$ and inference at $O(N)$ per test point.

Future work will focus on optimizing these complexities through anchor subsampling and "anchor weighting" techniques, such as using Shapley values to identify the most informative training points. To facilitate adoption, the authors have released the pdll Python library, which integrates seamlessly with the Scikit-learn ecosystem.

Summary updated

BibTeX
@inproceedings{belaid2024pairwise,
  author = {Mohamed Karim Belaid and Maximilian Rabus and Eyke Hüllermeier},
  title = {{Pairwise Difference Learning for Classification}},
  booktitle = {DS},
  year = {2024},
}
Figure