Abstract
Ordinal regression is a common task in machine learning where categories have a natural ordering, such as age groups or image quality ratings. Standard classification approaches often ignore this order, treating all misclassifications equally. This paper introduces Soft Ordinal Labels (SORD), a method that replaces traditional one-hot labels with soft probability distributions based on metric distances between classes. SORD allows standard deep learning architectures to incorporate ordinal information through cross-entropy loss without architectural modifications. The method achieves state-of-the-art results across various tasks, including age estimation, depth prediction, and image aesthetics ranking.
Introduction: The Challenge of Ordinal Data
In standard machine learning classification, categories are typically treated as independent. For instance, in a dog-vs-cat classifier, confusing a dog for a cat is penalized the same as confusing it for a car. However, many real-world problems involve ordinal categories—classes with a natural, inherent order. Examples include movie ratings (1 to 5 stars), age groups, or image aesthetics. In these scenarios, predicting "3 stars" for a "4-star" movie is a much better outcome than predicting "1 star."
Traditional ordinal regression methods often rely on complex architectural changes, such as ensembles of binary classifiers. These can be difficult to implement and integrate with modern deep learning frameworks. The authors of this paper propose a simpler alternative: baking "order awareness" directly into the training labels.
The SORD Method: Encoding Distance into Labels
The core innovation is SORD (Soft Ordinal Labels). Instead of representing a ground truth label as a one-hot vector (a 1 at the correct index and 0s elsewhere), the authors represent it as a soft probability distribution.
- Metric Penalties: A distance function $\phi(r_t, r_i)$ is defined to measure the distance between a candidate rank $r_i$ and the true rank $r_t$.
- Softmax Encoding: These distances are passed through a Softmax-like function to create a distribution. The resulting vector assigns the highest value to the true class, while neighboring classes receive progressively smaller values based on their proximity.
- Standard Training: Since the ground truth is now a probability distribution, the model can be trained using standard Cross-Entropy loss.
This "off-the-shelf" approach requires no modifications to the neural network architecture (e.g., ResNet or VGG). It also handles continuous data effectively; for example, if a true depth value falls between two discrete "bins," SORD creates a label that smoothly balances between them.
Experimental Evaluation
The authors evaluated SORD across four diverse computer vision tasks:
- Image Aesthetics: Ranking image quality from "unacceptable" to "exceptional" using the Aesthetics dataset.
- Age Estimation: Classifying face images into eight age groups using the Adience dataset.
- Monocular Depth Estimation: Predicting distance from a single RGB image using the KITTI dataset.
- Horizon Line Regression: Estimating the angle and offset of the horizon using the Horizon Lines in the Wild (HLW) dataset.
Key Insights and Results
SORD demonstrates that complex architectural "hacks" are unnecessary for handling ordinal data. By making labels "aware" of their neighbors, the network's gradients naturally push predictions toward the correct neighborhood. Mathematically, using SORD with Cross-Entropy loss simplifies the gradient, effectively penalizing the network based on the metric distance between the predicted distribution and the soft ground truth.
Performance Highlights
- KITTI Depth Benchmark: SORD achieved 2nd place among all published methods at the time, outperforming many highly specialized, complex models.
- Adience Age Estimation: SORD improved categorical accuracy by over 2% and reduced the Mean Absolute Error (MAE) by 0.05 units compared to traditional hard-label baselines.
- Horizon Estimation: On the HLW dataset, SORD outperformed the baseline by over 7% in terms of Area Under the Curve (AUC).
Furthermore, SORD acts as a bridge between classification and regression. By discretizing a continuous range into bins and using soft labels, a classification network can perform high-precision regression. The method is also remarkably robust to the choice of binning; performance tends to plateau rather than degrade even with an excessive number of bins.
Conclusion and Future Directions
While SORD is highly effective, it introduces hyperparameters such as the choice of distance metric $\phi$ and the "temperature" of the soft distribution, which require tuning for specific tasks. Additionally, the authors noted that soft labels with higher entropy might require adjusted learning rates to avoid local minima.
Future work could involve expanding SORD to other domains beyond computer vision, such as NLP sentiment analysis or medical staging, where ordinal relationships are prevalent. Overall, SORD provides a simple, powerful, and easily integrable solution for ordinal regression in deep learning.
Summary updated