Belay That Token: Free Spatial Priors for Semi-Supervised Hierarchical Multi-Label Classification

Dubravko Ćulibrk, Nikola Marić, Filip Josifljević, Boshko Koloski, Dragi Kocev, Marko Pavlović, Sašo DžeroskiarXiv 2026

TL;DR

When Vision Transformers are trained to classify multiple objects per image with only a few labeled examples, their "class tokens"—each meant to look at a different object—secretly collapse and all stare at the exact same patches. BELAY fixes this by using a free, off-the-shelf segmentation model to tell each token roughly where its class lives during training, then throwing the helper away at test time. This simple spatial nudge boosts accuracy across four aerial and natural-scene datasets by 1.8 to 11.2 AUPRC points, at zero extra inference cost.

What Problem Does This Paper Address?

Real-world images rarely contain just one thing. An aerial photo might show buildings, cars, and trees—all of which also belong to broader categories like man-made or vegetation. Predicting all of these labels at once while respecting their family tree is called hierarchical multi-label classification (HMC). Because labeling every level of a hierarchy is expensive, practitioners usually work in a semi-supervised setting: only a small fraction of images (say, 10%) have labels, while the rest are unlabeled.

To handle this, modern Vision Transformers (ViTs) assign each class its own learnable class token (or a label query in decoder-based models). In theory, the car token should attend to cars, and the tree token should attend to trees.

The authors show that in practice, this doesn't happen. When labels are scarce, the last-block attention maps of different class tokens collapse onto a single, nearly identical map (with a pairwise cosine similarity of 0.96–1.00). They barely prefer their own class's region over the rest of the image. Even more surprisingly, the authors rule out the usual suspects: this collapse isn't caused by the classifier head, "attention sinks" (high-norm background patches), or how the tokens are initialized.

Figure 1. Class tokens look everywhere until they are grounded. Last-block attention of one class token (mean over heads), with the class’s true coverage on the left. Without spatial supervision (class tokens), every class token attends to the same few patches, whatever its class. Grounding the tokens on a training-free segmentation prior (BELAY) moves each token’s attention onto its class, close to what grounding on true masks achieves. Numbers give the mask lift: the token’s attention on its class region relative to the region’s share of the image (1 = uniform, higher value is better). The images come from a fixed selection rule (test images with two leaves that each cover at least 15 of the 196 patches, shown for the smaller leaf). The first UCM example and the second COCO-Stuff example are shown. More examples are provided in the supplementary material.

Methods

Named after the climbing technique that holds a climber in place and comes off once they're safe, BELAY grounds each class token's attention during training and leaves inference untouched:

  1. Free Spatial Priors (Offline): Before training begins, the authors run a training-free open-vocabulary segmenter (SegEarth-OV3 for aerial images; CLIP-based SegEarth-OV for natural scenes) on every training image—labeled or not. Prompted with the leaf class names, the segmenter assigns each pixel to its highest-scoring class.
  2. Hierarchical Targets: These pixel maps are pooled onto the ViT's $14 \times 14$ patch grid. For any parent class in the hierarchy, its target map is simply the union (sum) of its descendants' patch coverages, normalized to form a probability distribution $t_n$.
  3. Grounding Loss: During training, a KL-divergence loss pulls each supervised token's last-block attention $a_n$ toward its target $t_n$. This runs alongside a standard supervised loss on labeled images and a self-supervised BYOL loss on all images.
  4. Consistent Predictions: A max-constraint layer guarantees that a child class's predicted probability never exceeds its parent's ($\hat{p}_{\text{child}} \le \hat{p}_{\text{parent}}$), eliminating hierarchy violations.

At test time, the segmenter and grounding loss are discarded—the model is just a plain class-token ViT. The authors also show that the exact same grounding principle works for label-query decoders like Query2Label by supervising their last cross-attention layer.

Figure 2. Overview of BELAY. Offline, a training-free open-vocabulary segmenter assigns every pixel of every training image, labeled or not, to a leaf class. Pooled to the 14 × 14 patch grid and summed over each node’s descendants, this gives one attention target tn per node - a parent’s target contains its children’s. During training, the last-block attention an of each node’s class token is pulled towards tn, alongside the supervised loss on labeled images and BYOL on all images, and a max-constraint layer makes the predictions consistent with the hierarchy. The inset shows the same principle in a label-query decoder: the cross-attention of each class query is supervised with the same targets and loss (Sec. 3.5). The toy scene is illustrative.

Datasets

All experiments use a ViT-B/16 backbone with 10% of training images labeled across four multi-label datasets that include pixel masks (allowing comparison against an "oracle" grounded on true masks):

  • UC Merced (UCM): 2,100 aerial images, 17 classes in a 30-node hierarchy.
  • Potsdam: 3,800 high-res orthophoto patches, 6 classes in an 8-node hierarchy.
  • FLAIR #1: 77,412 aerial patches, 18 land-cover classes in a 24-node hierarchy.
  • COCO-Stuff: 118k+ everyday scene images, 171 thing/stuff classes under 27 supercategories (198 nodes total).

Key Insights and Ideas

  • Location matters more than classification: The free segmenters are actually poor classifiers on their own (presence AUPRC of 0.51–0.69 on three of the four datasets). Using them as pseudo-labels or for late fusion performs much worse than BELAY. Yet their spatial maps still drive big gains.
  • Sharpness beats accuracy: By systematically degrading true masks on UCM, the authors found that blurring or shifting boundaries destroys the gain, while randomly dropping or adding wrong classes (at a 30% rate) still keeps 83% of the oracle's gain. Hard pixel assignments beat soft probability scores for the same reason: they point sharply at where things are.
  • Unlabeled images do the heavy lifting: Grounding on true masks for only the 10% labeled images recovers just 38–73% of the oracle gain. The rest comes from grounding on the unlabeled images.
Figure 3. What a prior needs. (a) Degrading true masks on UCM: coarse or misplaced targets destroy the gain, while targets for wrong classes cost little. (b) The share of the gain kept rises with the targets’ lift, how much more of each target falls on its class’s true region than a uniform map would put there (on image–class pairs where the class is present); the real priors keep more than degraded masks of equal lift, and hard targets from both segmenters beat their soft scores. Analysis model of the oracle study.

Key Results

  • Consistent Accuracy Gains: With 10% labels, BELAY improves macro AUPRC over ungrounded class tokens by +2.15 (UCM), +1.81 (Potsdam), +2.57 (FLAIR #1), and +11.17 (COCO-Stuff) points, recovering 67–93% of the oracle gain from true masks.
  • Beats All Baselines: BELAY outperforms HELM-style hierarchy tokens, Query2Label, ML-Decoder, CAP, and C-HMCNN on every dataset.
  • Generalizes to Query Decoders: Grounding Query2Label improves it by +1.98 to +6.66 points, matching BELAY's accuracy—though BELAY does it with roughly a third of the parameters (85.9M vs. 238.6M) and 60–76% of the FLOPs.
  • Zero Hierarchy Violations: The constraint layer reduces image-level hierarchy violations from up to 15.15% down to 0.00%.

Limitations and Future Work

BELAY is only as good as the prior's sense of place. On FLAIR #1, which includes abstract, hard-to-prompt classes like pervious surface and ligneous, the segmenter's mIoU drops to 0.19 and BELAY recovers two-thirds of the oracle gain. Prompts were also fixed upfront and not tuned. Finally, the main experiments use a single $224 \times 224$ ViT-B/16 backbone, so the COCO-Stuff results aren't directly comparable to standard high-resolution COCO benchmarks.

Summary updated

BibTeX
@misc{culibrk2026belay,
  author = {Dubravko Ćulibrk and Nikola Marić and Filip Josifljević and Boshko Koloski and Dragi Kocev and Marko Pavlović and Sašo Džeroski},
  title = {{Belay That Token: Free Spatial Priors for Semi-Supervised Hierarchical Multi-Label Classification}},
  year = {2026},
  eprint = {2612.05239},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2612.05239},
}
Figure