Introduction
Current semantic segmentation models typically treat object classes as a "flat" list of disjoint labels. This approach ignores the inherent hierarchical relationships of the visual world—for instance, a "car" is fundamentally a "vehicle," and a "motorcyclist" is a "rider" which is a "human." This hierarchy-agnostic approach leads to two primary issues: logical inconsistency and the inability to distinguish the severity of errors. A model might correctly identify a pixel as a "car" at a fine-grained level but fail to categorize it as a "vehicle" at a coarser level. Furthermore, standard models treat the relationship between a car and a truck the same way they treat the relationship between a car and a tree, failing to penalize "egregious" mistakes (e.g., confusing a pedestrian for a lamppost) more heavily than "reasonable" ones (e.g., confusing a bicycle for a motorcycle).
To bridge the gap between human perception and machine classification, we introduce the Hierarchical Semantic Segmentation Network (HSSN). HSSN is a framework designed to force models to respect class taxonomies through novel loss functions that regularize both pixel predictions and the underlying feature embedding space.
Methodology: The HSSN Framework
HSSN is a general framework that can be "plugged into" existing architectures like DeepLab, OCRNet, or MaskFormer with minimal changes. It relies on two main strategies:
Focal Tree-Min Loss ($L^{FTM}$)
Instead of a standard cross-entropy loss on leaf nodes, HSSN treats segmentation as a pixel-wise multi-label classification task across the entire hierarchy. This loss explicitly penalizes "hierarchy violations." For example, if a child node (e.g., Car) has a higher confidence score than its parent node (e.g., Vehicle), the model is penalized. This ensures the Positive/Negative $\mathcal{T}$-Property: if a child is positive, the parent must be; if a parent is negative, the child must be. The "Focal" component further helps the model focus on harder-to-classify pixels.
Tree-Triplet Loss ($L^{TT}$)
This loss reshapes the pixel embedding space. It uses the "tree distance" (the number of edges between two classes in the hierarchy) to define margins for a triplet loss. This forces the model to pull semantically similar classes (like "bus" and "truck") closer together in the feature space while pushing dissimilar classes (like "bus" and "road") further apart. This moves beyond binary "same/different" labels and creates a continuous "semantic landscape" where the distance between features actually carries semantic meaning.
During inference, instead of just picking the highest-scoring leaf, HSSN finds the highest-scoring root-to-leaf path in the hierarchy, ensuring the final output is logically consistent across all levels of granularity.
Experimental Setup and Datasets
The researchers evaluated HSSN on four major datasets with varying hierarchical complexities:
- Mapillary Vistas 2.0: A massive street-scene dataset with 144 categories organized into a 3-level hierarchy.
- Cityscapes: The gold standard for urban navigation, grouped into 19 fine-grained classes and 6 super-classes.
- LIP (Look Into Person): A human parsing dataset with 19 semantic parts.
- PASCAL-Person-Part: A dataset focused on body part segmentation (e.g., "upper-arm" vs. "upper-body").
Key Results
HSSN consistently outperformed hierarchy-agnostic baselines across all datasets and architectures:
- Quantitative Performance: On Mapillary Vistas 2.0, using a ResNet-101 backbone, HSSN improved mIoU by 2.69% to 3.40% across different hierarchy levels compared to DeepLabV3+. On Cityscapes, combined with MaskFormer (Swin-Small), it achieved a new state-of-the-art, outperforming the base model by 1.17% to 1.43% mIoU.
- Qualitative Improvements: Visual results show that HSSN is much better at handling occlusions and small objects. It specifically reduces "severe" errors, such as misclassifying parts of a truck as background, by leveraging the hierarchical prior.
Discussion and Conclusion
HSSN demonstrates that class hierarchies are not just organizational tools but powerful priors for regularization. By enforcing logical consistency and shaping the semantic embedding space, HSSN improves the robustness of existing SOTA models without adding significant computational overhead during deployment.
However, some limitations remain. The model relies on a pre-defined, static hierarchy, whereas real-world taxonomies can be ambiguous or context-dependent. Additionally, while the path-search during inference is relatively simple, it adds a small layer of logic compared to a simple argmax operation. Future work could explore "learning" the hierarchy dynamically or handling overlapping taxonomies.
Summary updated