Rethinking Learnable Tree Filter for Generic Feature Transform

Lin Song, Yanwei Li, Zhengkai Jiang, Zeming Li, Xiangyu Zhang, Hongbin Sun, Jian Sun, Nanning Zheng

Introduction

In computer vision, capturing "global context"—understanding how a pixel on one side of an image relates to a pixel on the other—is a holy grail. Standard Convolutional Neural Networks (CNNs) are notoriously "nearsighted," focusing primarily on local neighborhoods.

To address this, researchers previously developed the Learnable Tree Filter (LTF-V1). It builds a "Minimum Spanning Tree" (MST) across image pixels to aggregate features. Because it relies on a tree structure, it preserves sharp object boundaries much better than blurry global attention mechanisms. However, LTF-V1 suffered from two major limitations:

  1. The Geometric Constraint: Information traveling across the tree must pass through every intermediate node. This causes the signal to decay, forcing the model to focus on nearby pixels and ignore distant ones.
  2. Non-Differentiability: The MST algorithm used to build the tree wasn't differentiable, meaning the network couldn't "learn" how to build better trees during training.
Conceptual comparison of LTF-V1 and LTF-V2

Methodology: Introducing LTF-V2

To overcome the inability to model long-range dependencies, the authors introduce LTF-V2, which overhauls the filter through a more rigorous mathematical framework.

LTF-V2 Network Architecture and Module

The new architecture tackles the previous limitations using three core innovations:

  • Markov Random Field (MRF) Reformulation: The researchers treat the tree filter as an inference problem on a graph. This reformulation allows the addition of a learnable unary term—essentially a "confidence score" for each pixel. This term allows the model to "boost" the importance of distant pixels, effectively breaking the geometric constraint that previously favored only close neighbors.
  • Learnable Spanning Tree (RST): The rigid MST algorithm is replaced with a Random Spanning Tree (RST) algorithm. By using stochastic sampling during training, the authors create a "gradient tunnel." This allows the backpropagation algorithm to influence how the tree is constructed, making the entire process end-to-end learnable.
  • Linear Complexity: Crucially, because the underlying structure remains a tree, the computation time grows linearly ($O(N)$) with the number of pixels. This is a massive efficiency advantage over standard self-attention mechanisms (like Transformers), which scale quadratically ($O(N^2)$).

Key Insights

The most significant breakthrough in LTF-V2 is the realization that the unary and pairwise terms are complementary. The unary term identifies which distant regions are interesting, while the pairwise term (the tree structure) ensures the details and boundaries of those regions are preserved.

Furthermore, unlike global attention which often "blurs" features, the tree-based approach is inherently aware of object boundaries because the tree edges are weighted by pixel similarity. As image resolutions increase, the efficiency gap between LTF-V2 and attention-based "Non-Local" methods widens significantly, making LTF-V2 highly practical for high-resolution tasks like medical imaging or autonomous driving.

Datasets and Results

The authors evaluated LTF-V2 on industry-standard vision benchmarks, including COCO 2017 (object detection/instance segmentation), Cityscapes (high-resolution semantic segmentation), and ImageNet (backbone pre-training).

  • Object Detection (COCO): When integrated into a Mask R-CNN baseline, LTF-V2 provided a 2.4% absolute gain in bounding box accuracy ($AP_{box}$) and a 1.8% gain in mask accuracy ($AP_{seg}$), all with negligible computational overhead.
  • Semantic Segmentation (Cityscapes): The model achieved a leading 82.1% mIoU (mean Intersection over Union), outperforming several complex state-of-the-art models.
  • Speed: Qualitative benchmarks demonstrate that LTF-V2 is significantly faster than Non-Local blocks, especially as the number of pixels scales toward 50,000 and beyond.

Limitations and Future Work

While LTF-V2 is a major step forward, the authors note a few areas for future exploration:

  • Deterministic Inference: While tree construction is random during training to facilitate learning, the model reverts to a standard MST during inference to keep results deterministic. Finding a more elegant way to handle tree selection during inference remains an open challenge.
  • Graph vs. Tree: A tree is a simplified graph with no loops. While efficient, it might miss complex multi-path relationships that a full graph could capture.
  • Expansion to NLP: The authors suggest that this "linear-time global context" could potentially replace expensive attention modules in Natural Language Processing (NLP) Transformers, though this application has yet to be demonstrated.

Summary updated

BibTeX
@inproceedings{song2020rethinking,
  author = {Lin Song and Yanwei Li and Zhengkai Jiang and Zeming Li and Xiangyu Zhang and Hongbin Sun and Jian Sun and Nanning Zheng},
  title = {{Rethinking Learnable Tree Filter for Generic Feature Transform}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2020},
}
Figure