When Labels Have Structure: Improving Image Classification with Hierarchy-Aware Cross-Entropy

April Chan, Davide D'Ascenzo, Sebastiano Cultrera di Montesano
5/7/2026
cs.LGcs.CV

No confident code implementation found for this paper.

Abstract

Standard cross-entropy is the default classification loss across virtually all of machine learning, yet it treats all misclassifications equally, ignoring the semantic distances that a class hierarchy encodes. We propose Hierarchy-Aware Cross-Entropy (HACE), a drop-in replacement for standard cross-entropy that incorporates a known class hierarchy directly into the loss.

Show full abstract

HACE combines two components: prediction aggregation, which propagates the model's probability mass upward through the class hierarchy to ensure that parent nodes accumulate the confidence of their children; and ancestral label smoothing, which distributes the ground-truth signal along the path from the true class to the root. We evaluate HACE on CIFAR-100, FGVC Aircraft, and NABirds in two regimes: end-to-end training across six architectures spanning convolutional and attention-based designs, and linear probing on frozen DINOv2-Large features. In end-to-end training, HACE improves accuracy over standard cross-entropy in 15 out of 18 architecture--dataset pairs, with a mean gain of 4.66\%. In linear probing on frozen DINOv2-Large features, HACE outperforms all competing methods on all three datasets, with a mean improvement of 2.18\% over the next best baseline.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{chan2026when,
  title  = {When Labels Have Structure: Improving Image Classification with Hierarchy-Aware Cross-Entropy},
  author = {April Chan and Davide D'Ascenzo and Sebastiano Cultrera di Montesano},
  year   = {2026},
  eprint = {2605.06274},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2605.06274v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2605.06274.svg)](https://codeofpaper.com/paper/2605.06274)

Discussion