Introducing Curvature to the Label Space

Conor Sheehan, Ben Day, Pietro LiòarXiv 2018

Abstract

One-hot encoding is a labelling system that embeds classes as standard basis vectors in a label space. Despite seeing near-universal use in supervised categorical classification tasks, the scheme is problematic in its geometric implication that, as all classes are equally distant, all classes are equally different. This is inconsistent with most, if not all, real-world tasks due to the prevalence of ancestral and convergent relationships generating a varying degree of morphological similarity across classes. We address this issue by introducing curvature to the label-space using a metric tensor as a self-regulating method that better represents these relationships as a bolt-on, learning-algorithm agnostic solution. We propose both general constraints and specific statistical parameterizations of the metric and identify a direction for future research using autoencoder-based parameterizations.

Introduction: The Problem with Flat Label Spaces

In modern deep learning, one-hot encoding is the undisputed standard for classification tasks. By representing each class as a unit vector in a high-dimensional space, we implicitly define a "flat" Euclidean geometry where every category is equidistant from every other category.

However, this geometric assumption contradicts the hierarchical and relational nature of the real world. For instance, a model that confuses a "Husky" for a "Wolf" has captured more relevant features than one that confuses a "Husky" for a "Toaster." Standard loss functions like Categorical Cross-Entropy (CCE) treat both errors as equally catastrophic, failing to reward "near misses" that reflect morphological or semantic similarity.

Implied real separation of classes like Car, Dog, and Cat, where biological categories are closer to each other than to mechanical ones.

Methodology: Curving the Label Space

To address this, we propose introducing curvature to the label space. Instead of a rigid Euclidean distance, we employ a metric tensor ($g_{\alpha\beta}$) to define a non-flat geometry. This allows the distance between classes to vary based on their inherent similarities.

Curved Loss Functions

We derive "curved" variants of standard loss functions:

  • Curved Mean Squared Error (CQE)
  • Curved Categorical Cross-Entropy (CCE)

In these formulations, the loss incurred by a misclassification is weighted by the metric tensor value between the true and predicted classes. This effectively communicates to the learning algorithm that some mistakes are "better" than others.

Self-Regulating Parameterization

A key challenge is determining the values of the metric tensor without labor-intensive manual labeling of hierarchies. We introduce a self-regulating method that utilizes the model's own confusion matrix during training.

The confusion matrix on the CIFAR-10 test set provides an empirical basis for determining class similarities.

If a model frequently confuses two classes (e.g., "Cat" and "Dog"), the metric tensor automatically adjusts to bring those classes closer in the label space. To ensure stability, we apply an exponential moving average (EMA) to update these similarities over time, preventing the geometry from fluctuating wildly due to noisy early-training batches. This "bolt-on" approach requires no changes to the underlying model architecture.

Experimental Results

The proposed method was evaluated on the CIFAR-10 and CIFAR-100 datasets using an All-Convolutional Network baseline. These benchmarks consist of natural images across 10 and 100 classes, respectively.

Quantitatively, the experiments did not yield a significant improvement in top-1 accuracy compared to the standard flat label space. Similar results were observed in transfer-learning tasks (moving from CIFAR-10 to CIFAR-100). While the performance gains were neutral, the study serves as a formal mathematical proof-of-concept for non-Euclidean label spaces in classification.

Discussion and Future Work

The lack of immediate performance gains suggests several avenues for refinement:

  1. The Proxy Problem: Using the confusion matrix during active learning may be too noisy, potentially reinforcing early initialization errors.
  2. Latent Space Metrics: Future research should explore defining the metric tensor based on an autoencoder’s latent space. This would ground class distances in the actual feature distributions of the data rather than just the model's output errors.
  3. Curriculum Learning: Curvature could be used to implement a dynamic curriculum, where the loss function is adjusted to focus on the most informative "near-miss" examples as training progresses.

By formalizing the geometry of the label space, we open the door to models that better understand the nuanced relationships between the categories they are tasked to distinguish.

Summary updated

Abstract

One-hot encoding is a labelling system that embeds classes as standard basis vectors in a label space. Despite seeing near-universal use in supervised categorical classification tasks, the scheme is problematic in its geometric implication that, as all classes are equally distant, all classes are equally different. This is inconsistent with most, if not all, real-world tasks due to the prevalence of ancestral and convergent relationships generating a varying degree of morphological similarity across classes. We address this issue by introducing curvature to the label-space using a metric tensor as a self-regulating method that better represents these relationships as a bolt-on, learning-algorithm agnostic solution. We propose both general constraints and specific statistical parameterizations of the metric and identify a direction for future research using autoencoder-based parameterizations.
BibTeX
@misc{sheehan2018introducing,
  author = {Conor Sheehan and Ben Day and Pietro Liò},
  title = {{Introducing Curvature to the Label Space}},
  year = {2018},
  eprint = {1810.09549},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1810.09549},
}
Figure