Visual Dependency Transformers: Dependency Tree Emerges from Reversed Attention

Mingyu Ding, Yikang Shen, Lijie Fan, Zhenfang Chen, Zitian Chen, Ping Luo, Joshua B. Tenenbaum, Chuang Gan

TL;DR

Visual Dependency Transformers (DependencyViT) introduce a novel "reversed attention" mechanism that allows Vision Transformers to automatically learn hierarchical relationships between image patches without any manual labels. This approach enables the model to induce dependency trees (like "wheel is part of car") unsupervisedly, leading to significant gains in part segmentation and highly efficient "lite" models through dynamic patch pruning.

The Challenge: Capturing Visual Hierarchies

When humans look at a scene, we don't just see a grid of pixels; we see a hierarchy of objects and their constituent parts. For example, we perceive a "laptop" as a root entity composed of a "screen" and a "keyboard."

Standard Vision Transformers (ViTs), however, treat all image patches equally. Their self-attention mechanism is "gathering-based," where each token collects information from all others globally. While powerful, this doesn't explicitly capture the structural dependencies of the visual world. Previous attempts to build these hierarchies usually relied on heavy supervision or were restricted to specific object detection frameworks. The authors of this paper ask: Can we induce these visual hierarchies efficiently and unsupervisedly directly from the image patches?

Visual hierarchy of objects and parts induced by DependencyViT through reversed attention.

Methodology: The Dependency Block

The core innovation is the Dependency Block, which modifies standard self-attention in three key ways:

  1. Reversed Attention: In standard attention, a token gathers information. In reversed attention, the authors transpose the adjacency matrix so that a "child" token sends information to its "parent" token. This naturally mimics a dependency tree where information flows from the leaves (fine details) to the root (the main object).
  2. Head Selector: Since ViTs use multiple attention heads, not all are equally good at capturing dependencies. A learnable "soft head selector" chooses the best heads for inducing the tree structure.
  3. Message Controller: This module determines the extent to which a specific node or subtree should send messages, helping the model filter out meaningless background patches.

To make the model efficient, the authors introduce DependencyViT-Lite. By identifying "leaf nodes" that receive or transmit very little information, the model can prune them dynamically as the network gets deeper. Crucially, because the model maintains a dependency tree, the information from pruned patches can be "retrieved" from their parents for dense tasks like segmentation.

Key Insights: Emergent Semantics

A significant finding is that the model learns semantic groupings (e.g., patches forming a wing) without explicit part labels. The nature of these dependencies is influenced by the pretraining protocol.

Comparison of patch merging and part dependency trees under weakly-supervised and self-supervised pretraining regimes.
  • Structure from Transposition: The simple act of transposing the attention matrix changes the fundamental logic of the Transformer from "global gathering" to "hierarchical sending," allowing trees to emerge naturally.
  • Supervision Matters: The authors found that self-supervised pretraining (iBOT) tends to capture finer-grained "part-to-part" dependencies, while weakly-supervised pretraining (using labels) focuses more on "part-to-whole-object" relationships.
  • Efficiency via Hierarchy: Because the model understands the dependency structure, it knows which patches are redundant. Pruning in DependencyViT-Lite isn't just random; it's structurally informed, allowing for massive computational savings (up to 10x complexity reduction in some layers) with minimal performance loss.

Key Results

The model was pretrained on ImageNet-1K and evaluated across tasks including unsupervised part segmentation (Pascal-Part), saliency detection (DUTS), and object detection (COCO 2017).

  • Superior Part Discovery: On the Pascal-Part dataset, DependencyViT achieved 28.7% mIoU, significantly outperforming the standard DeiT baseline (18.9%) in unsupervised part segmentation.
  • Performance Boost: On ImageNet-1K classification, DependencyViT-Tiny reached 75.4% Top-1 accuracy, a 3.2% improvement over the standard DeiT-Tiny.
  • Extreme Efficiency: The "Lite" version of the model is incredibly lean. For object detection on COCO, the DependencyViT-Lite backbone uses only 3.5 GFLOPs, representing just 1.5% of the total network's computation, while remaining competitive with much heavier models.

Limitations and Future Work

The authors acknowledge that the current implementation uses a fixed patch size (16x16), which limits the model's ability to resolve very small objects or extremely fine-grained details. Future work involves scaling the model to larger architectures and exploring multi-scale patch sizes to better capture dependencies at different levels of granularity. There is also potential to apply this "reversed attention" logic to other modalities, such as point clouds or multi-modal vision-language tasks.

Summary updated

BibTeX
@inproceedings{ding2023visual,
  author = {Mingyu Ding and Yikang Shen and Lijie Fan and Zhenfang Chen and Zitian Chen and Ping Luo and Joshua B. Tenenbaum and Chuang Gan},
  title = {{Visual Dependency Transformers: Dependency Tree Emerges from Reversed Attention}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2023},
}
Figure