ViT-NeT: Interpretable Vision Transformers with Neural Tree Decoder

Sangwon Kim, Jae-Yeal Nam, ByoungChul KoICML 2022 · OpenReview

Introduction

Deep learning models, particularly Vision Transformers (ViTs), have become the gold standard for image classification. However, they are notoriously "black boxes." While we can generate attention maps to see where a model is looking, these maps are often ambiguous and fail to explain the actual logic or sequence of the decision-making process.

This opacity is especially problematic in Fine-Grained Visual Categorization (FGVC)—tasks like distinguishing between two very similar species of birds where the difference lies in tiny, localized details. Existing interpretable models often face a "transparency tax," where making the model understandable to humans significantly degrades its accuracy.

ViT-NeT bridges this gap by replacing standard classification heads with a Neural Tree Decoder. It achieves state-of-the-art results on fine-grained classification tasks while providing a clear, sequential visual path explaining exactly which features led to its final prediction.

Architecture and Methods

The researchers propose a hybrid architecture that combines a powerful transformer backbone with a structured, hierarchical decoder.

ViT-NeT Architecture
  1. Hierarchical ViT Backbone: The model uses a Swin Transformer to extract high-quality local and global features. Unlike standard ViTs, the Swin architecture handles variations in object scale better by using a shifted window mechanism.
  2. Neural Tree Decoder (NeT): Instead of a flat "Softmax" layer at the end, the model uses a perfect binary tree. Each internal node in the tree acts as a decision point.
  3. Differentiable Branch Routing: At each node, the model compares image patches against learned "prototypes" (trainable tensors representing specific visual concepts). Based on the similarity between the image and these prototypes, the model "routes" the data down a specific path in the tree.
  4. Contextual Transformer Module (CTM): To ensure the tree nodes don't lose sight of the big picture, the CTM aggregates global context and injects it into the patches at each edge of the tree.
  5. Leaf Node Prediction: Once the data reaches a leaf, a final classification is made using a combination of the local features found along the path and the global representation of the image.

Key Insights and Performance

Unlike "post-hoc" methods (like Grad-CAM) that try to explain a model after it's trained, ViT-NeT is intrinsically interpretable. The decision path through the tree represents the actual logic the model used.

Sequential Decision Path
  • Sequential Logic: The tree structure mimics human reasoning. For example, a node might first look for a specific wing pattern to narrow down the bird family, then a subsequent node looks for a distinct beak shape to identify the specific species.
  • The "Depth" Trade-off: The authors found that tree depth is a critical hyperparameter. A tree that is too shallow lacks the capacity to distinguish complex classes, while a tree that is too deep (e.g., depth > 6) tends to overfit, focusing on identical pixels across different branches.
  • Solving the Trade-off: Most importantly, the paper demonstrates that adding this interpretable structure actually improves performance over "vanilla" transformers, proving that transparency doesn't have to come at the cost of accuracy.

ViT-NeT outperformed or matched several state-of-the-art (SOTA) models across all evaluated datasets:

  • CUB-200-2011 (Birds): Achieved 91.6% accuracy (using a SwinT-B backbone), surpassing the previous SOTA.
  • Stanford Dogs: Reached 93.6% accuracy (using a DeiT-B backbone).
  • Stanford Cars: Reached 95.0% accuracy.

Limitations and Future Work

While highly effective, ViT-NeT has a few limitations. The optimal tree depth varies by dataset (e.g., depth 4 was best for birds, while depth 6 was better for dogs/cars), requiring manual tuning based on category complexity. Additionally, in datasets with complex backgrounds, the model's performance was slightly more sensitive to the choice of backbone, suggesting the "prototyping" mechanism can sometimes be distracted by non-object features.

Future work could involve developing adaptive tree structures that don't require pre-defining the depth, or applying this architecture to larger-scale, non-fine-grained datasets.

Summary updated

BibTeX
@inproceedings{kim2022vit,
  author = {Sangwon Kim and Jae-Yeal Nam and ByoungChul Ko},
  title = {{ViT-NeT: Interpretable Vision Transformers with Neural Tree Decoder}},
  booktitle = {International Conference on Machine Learning},
  year = {2022},
  url = {https://openreview.net/forum?id=JlIIllJGMjM},
}
Figure