Learning State-Based Node Representations from a Class Hierarchy for Fine-Grained Open-Set Detection

Spandan Pyakurel, Qi YuICML 2025

TL;DR

State-FGOD introduces a novel state-based representation that leverages class hierarchies to tackle the "near-OOD" (Out-of-Distribution) problem in fine-grained open-set detection. By modeling an entire class hierarchy as a space of "legal states" and ensuring optimal gradient updates across all nodes, the method significantly outperforms traditional local and global detectors in identifying subtle differences between known and unknown classes.

What Problem Does This Paper Address?

Open-set detection (OSD) is the task of identifying data samples that do not belong to any of the classes seen during training. This becomes exceptionally difficult in Fine-Grained Open-Set Detection (FGOD), where the "unseen" classes are semantically very similar to the "seen" ones. For example, a model might need to distinguish a rare, unseen species of sparrow from several common sparrow species it was explicitly trained on.

Hierarchical classification of fine-grained openset and closed-set bird species.

Existing approaches generally fall into two camps, both of which have significant flaws:

  1. Local Detectors: These work top-down through a hierarchy (e.g., Bird → Sparrow → Song Sparrow). If a mistake is made at the top level, the error cascades down, leading to poor overall performance.
  2. Global Detectors: These treat all leaf nodes as a flat list, entirely ignoring the rich relational data embedded in the hierarchy.

The authors also identify a theoretical "trap" in existing literature: standard hierarchical models that maximize "path probability" (the likelihood of the correct branch) are sub-optimal. They mathematically prove that these models fail to adequately suppress the logits (scores) of nodes on incorrect branches during training. This oversight leads to high false-positive rates when the model encounters similar-looking open-set samples.

Methods: Introducing State-FGOD

The authors propose State-FGOD, which moves away from simple path probabilities to a robust state-based node representation.

  • Augmented Hierarchy: The researchers add an "openset" child node to every non-leaf node in the hierarchy. This structural change allows the model to explicitly declare, "This is a sparrow, but not one of the specific sparrows I know."
  • Legal Global States: They define a "state" as a binary vector representing which nodes in the hierarchy are active. A state is only considered "legal" if it follows hierarchical logic (e.g., if the "Sparrow" node is active, its parent "Bird" node must also be active).
  • State-Based Probabilities: Instead of using a flat softmax function, the probability of a state is calculated by multiplying the exponentiated logits of all active nodes. This forces the model to consider the entire hierarchy simultaneously rather than making isolated local decisions.
  • Optimal Training: The authors prove mathematically that their custom loss function guarantees a crucial behavior: during training, the scores for the correct path increase while the scores for all incorrect nodes (even those on entirely different branches) decrease.
  • Dynamic Training: To simulate open-set samples during the learning phase, they employ a "leave-one-out" strategy. By temporarily removing known classes, they teach the model how to categorize them as "openset" at various levels of the tree.

Key Insights

  • Global View Matters: Local detectors are inherently "short-sighted." By formulating the problem as a transition between global states, the model learns to weigh evidence from the root to the leaves simultaneously.
  • The Gradient "Aha!": The most significant finding is the theoretical proof regarding gradients. In traditional path-based models, if a sample is a "California Gull," the model doesn't necessarily learn to lower the score for a "Fox Sparrow" because they reside on different branches. State-FGOD ensures that every non-ground-truth node is suppressed, leading to much sharper decision boundaries.
  • Hierarchical Precision: The method doesn't just detect that something is unknown; it detects where it belongs in the taxonomy. It can correctly identify an unknown bird as an "Openset Sparrow" rather than just a generic "Openset Bird."

Key Results

State-FGOD consistently outperformed all baselines (including E-HND and LOO) across several standard hierarchical and fine-grained benchmarks, including CUB-200-2011, Tiny ImageNet, and AWA2.

Performance comparison of State-FGOD against baselines across CUB, Tiny ImageNet, and AWA2 datasets.
  • AUC Improvements: The model achieved impressive gains of +5.45 on CUB, +2.45 on Tiny ImageNet, and +2.82 on AWA2 over the best-performing previous methods.
  • Top-2 Accuracy: On the CUB dataset, State-FGOD achieved a Top-2 AUC of 76.72, significantly higher than the next best baseline (74.08). This proves it is much more robust at "getting close" to the correct classification even when dealing with open-set data.
  • Hierarchical Metrics: It achieved the highest Hierarchical Precision (98.06% for closed-set) and Recall, indicating it maintains the integrity of the taxonomy far better than "flat" global detectors.

Limitations and Future Work

While highly effective, calculating probabilities across all legal states is more computationally intensive than a standard softmax. Though the authors note it is "fairly fast" and usable in practice, computation time scales with the complexity of the hierarchy. Additionally, the training relies on "hiding" known classes to simulate the unknown; while effective, it may not perfectly capture the distribution of truly novel out-of-distribution data. Future work will explore advanced data augmentation to generate more realistic synthetic open-set samples to further stress-test these hierarchical boundaries.

Summary updated

BibTeX
@inproceedings{pyakurel2025learning,
  author = {Spandan Pyakurel and Qi Yu},
  title = {{Learning State-Based Node Representations from a Class Hierarchy for Fine-Grained Open-Set Detection}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=NO7egHvBHa},
}
Figure