Abstract
In computer vision, standard classification models typically treat all errors as equally detrimental. However, in safety-critical applications, confusing a "Golden Retriever" with a "Labrador" is far less severe than confusing it with a "Toaster." This paper presents Hierarchy Aware Features (HAF), a training framework that encourages neural networks to learn feature spaces mirroring real-world taxonomies. By employing hierarchical consistency and geometric constraints, HAF reduces the severity of classification errors while maintaining or improving top-1 accuracy.
Introduction
Conventional deep learning models rely on cross-entropy loss, which assumes classes are independent. This "semantic indifference" is problematic when models encounter ambiguous or out-of-distribution data. Previous attempts to incorporate hierarchical information often suffered from a "performance tax," where reducing mistake severity came at the cost of overall accuracy. HAF addresses this by integrating label hierarchies directly into the feature learning process without sacrificing performance.
Methodology
The HAF framework consists of three primary components designed to align the model's internal representations with a given hierarchy:
- Soft Hierarchical Consistency ($L_{shc}$): Instead of using hard labels for coarse-level categories, HAF utilizes "soft labels" derived from fine-grained predictions. By minimizing the Jensen-Shannon Divergence (JSD) between levels, the model ensures that fine-grained features are compatible with broader taxonomic categories.
- Geometric Consistency ($L_{gc}$): This component constrains the weight vectors of classifiers. Specifically, it forces the weight vectors of sub-classes (e.g., "Orchid") to align geometrically with the weight vector of their parent super-class (e.g., "Flower"). This physical organization of the feature space ensures that semantic proximity is reflected in the model's geometry.
- Margin Loss ($L_m$): To maintain discriminative power, a pairwise margin loss is applied at coarser levels, preventing the model from collapsing distinct categories into a single cluster.
Experimental Setup
The authors evaluated HAF on three major hierarchical benchmarks, ranging from standard datasets to complex biological taxonomies.
- CIFAR-100: 100 classes mapped to a 6-level hierarchy.
- iNaturalist-19: A large-scale biological dataset with 1,010 species across 8 levels.
- tieredImageNet-H: A subset of ImageNet featuring a deep 13-level hierarchy.
Key Results
HAF achieved state-of-the-art performance in reducing "Mistake Severity," measured by the Average Lowest Common Ancestor (LCA) distance between the ground truth and the predicted label.
- Accuracy Preservation: On CIFAR-100, HAF maintained a top-1 error rate of approximately 22.27%, matching baseline performance while significantly improving the semantic quality of errors.
- Synergy with Post-hoc Methods: When combined with Conditional Risk Minimization (CRM), HAF reached peak performance, indicating that better-learned features enhance the effectiveness of test-time interventions.
- Scalability: Unlike previous methods that partitioned feature vectors—often failing on deep hierarchies—HAF's shared feature space scaled effectively to the 13-level depth of tieredImageNet-H.
- Coarse Accuracy: The model consistently outperformed baselines in coarse classification accuracy, demonstrating a superior ability to identify broader categories even when specific species were misidentified.
Conclusion
HAF provides a robust method for training hierarchy-aware models that fail gracefully. By aligning feature space geometry with taxonomic structures, the framework ensures that errors remain semantically sensible. Future work may explore hyperbolic feature spaces to better represent the inherent tree-like structure of hierarchical data.
Source Code: https://github.com/07Agarg/HAF
Summary updated