Learning Label Encodings for Deep Regression

Deval Shah, Tor M. Aamodt

TL;DR

This paper introduces Regularized Label Encoding Learning (RLEL), an end-to-end framework that automatically learns optimal label encodings for deep regression tasks. By relaxing discrete binary codes into a continuous search space and applying specific regularizers, RLEL outperforms direct regression by 10.9% and multiclass classification by 12.4% across diverse benchmarks like head-pose estimation and autonomous driving.

The Challenge of Deep Regression

In deep learning, "regression" typically involves training a network to output a single continuous number (such as an angle, age, or coordinate) by minimizing Mean Squared Error (MSE). However, this "direct regression" approach often underperforms compared to task-specific workarounds.

A powerful alternative is to treat regression as a binary classification problem. This involves quantizing the target value and representing it as an $M$-bit binary code. Doing so introduces redundancy and "ensemble diversity," allowing the model to correct its own errors.

The catch? Designing these binary codes (label encodings) is incredibly difficult. The search space of possible codes is massive. While manually designed codes can be effective, they require significant domain expertise and trial-and-error. Previous automated attempts, such as using autoencoders or simulated annealing, often failed to capture the unique "ordinal" nature of regression—where, for example, a value of 24 is inherently closer to 25 than it is to 80.

Introducing Regularized Label Encoding Learning (RLEL)

To overcome these limitations, the authors propose RLEL, a framework that moves away from fixed, hand-crafted binary codes to a system that learns the encoding and the model weights simultaneously.

1. Continuous Relaxation

Instead of searching through discrete bits (0s and 1s), RLEL operates in a continuous space of real-valued encodings. This relaxation allows the use of standard gradient-based optimization (backpropagation) to find the best "code" for a specific task directly during training.

2. Smart Regularization

To ensure the learned encodings actually improve regression performance, the authors introduce two key regularizers:

  • R1 (Distance-based): This regularizer forces the distance between two encodings to be proportional to the difference between their actual target values. This ensures that if the model makes a small mistake in the "code" space, it only results in a correspondingly small mistake in the final predicted value.
Effect of R1 Regularizer
  • R2 (Transition-based): This minimizes the number of "bit transitions" (flipping from 0 to 1) across the range of labels. Neural networks exhibit a "spectral bias," meaning they find it easier to learn smooth, low-frequency functions. R2 encourages the model to learn simpler decision boundaries, making the underlying classification tasks easier and reducing the Mean Absolute Error (MAE).
Effect of R2 Regularizer

3. The Architecture

The RLEL pipeline flows from a Feature Extractor to an Output Code, which is then multiplied by a learned Decoding Matrix ($D$) to produce a correlation vector. The final prediction is the expected value of this vector. Crucially, because the decoding matrix $D$ is learned alongside the network, the entire system is optimized end-to-end.

Key Insights and Results

The authors evaluated RLEL on 11 benchmarks across four major regression domains: Head Pose Estimation (BIWI, 300W-LP), Facial Landmark Detection (COFW, 300W, WFLW), Age Estimation (MORPH-II, AFAD), and Autonomous Driving (PilotNet).

  • Regression is Ordinal: Unlike standard classification, regression labels have a strict order. RLEL’s R1 regularizer explicitly bakes this ordinality into the learned representation, leading to more sensible error bounds.
  • Simplicity is Stability: By using R2 to reduce bit transitions, the authors align the task with the natural learning tendencies of neural networks. A "smooth" code is easier to generalize than a "noisy" one.
  • Superior Accuracy: RLEL achieved a 10.9% reduction in Mean Absolute Error (MAE) compared to direct regression and a 12.4% reduction compared to multiclass classification.
  • Outperforming Manual Design: RLEL-found encodings resulted in lower or comparable errors to the best manually designed codes without requiring human intervention. It also significantly outperformed other automated methods like Autoencoders (by ~2.1%) and Simulated Annealing (by ~12.6%).
  • Versatility: The method proved effective across different backbones (ResNet50, HRNet, PilotNet), showing it is a generic "plug-and-play" improvement for deep regression.

Limitations and Future Work

While RLEL automates code design, it introduces two new hyperparameters ($\alpha$ and $\beta$) to weight the regularizers. Although the authors show the model isn't overly sensitive to them, they still require some tuning. Additionally, the current work assumes a fixed number of quantization levels. Future work could explore learning the optimal quantization bins (non-uniform quantization) alongside the encodings. Finally, the addition of the decoding matrix adds a small amount of memory and compute overhead, though this is generally negligible compared to the cost of the main feature extractor.

Summary updated

BibTeX
@inproceedings{shah2023learning,
  author = {Deval Shah and Tor M. Aamodt},
  title = {{Learning Label Encodings for Deep Regression}},
  booktitle = {International Conference on Learning Representations},
  year = {2023},
  url = {https://openreview.net/forum?id=k60XE_b0Ix6},
}
Figure