Learning Hierarchical Image Segmentation For Recognition and By Recognition

Tsung-Wei Ke, Sangwoo Mo, Stella X. YuICLR 2024

Introduction

The CAST (Concurrently learns segmentation and recognition using Adaptive Segment Tokens) framework presents a paradigm shift in computer vision by integrating hierarchical image segmentation directly into the visual recognition process. By replacing fixed square patches with superpixels and utilizing graph pooling, the model learns to uncover part-to-whole relationships "for free" using only image-level labels. Remarkably, this approach allows CAST to significantly outperform massive models like the Segment Anything Model (SAM) in unsupervised part-whole discovery.

The Disconnect Between Recognition and Segmentation

Current computer vision models generally treat recognition (identifying what is in an image) and segmentation (identifying where pixels belong) as two isolated problems. Large-scale models like CLIP or standard Vision Transformers (ViTs) excel at classification but often lack "visual substantiation"—they might know an image contains a "dog" without understanding which specific pixels constitute the ear, the tail, or the body.

Conversely, state-of-the-art segmenters like SAM require massive amounts of manual mask supervision (billions of masks) and often fail to understand the hierarchical relationship between parts and wholes. Furthermore, standard ViTs rely on a grid of fixed square patches. While computationally convenient, these patches ignore the natural, organic contours of objects in the real world, arbitrarily splitting semantic parts.

The CAST Approach

The authors introduce CAST, which treats segmentation not as an isolated end-task, but as an internal process that actively supports and evolves with recognition. The architecture makes several key departures from standard Vision Transformers:

Comparison of standard patch-based ViT architectures versus the CAST superpixel approach.
  1. Adaptive Segment Tokens: Instead of dividing an image into a rigid grid of square patches, CAST uses superpixels (generated via the SEEDS algorithm) as its base visual units. These units naturally adhere to the edges and contours of objects, providing a better inductive bias.
  2. Progressive Graph Pooling: The model employs a hierarchical structure where fine segments are progressively merged into coarser segments using graph pooling. This mirrors a natural "part-to-whole" hierarchy (e.g., pixels → eye/nose → face → person).
  3. Recognition-Driven Learning: The entire hierarchy is trained using only image-level objectives, such as standard classification or self-supervised instance discrimination. Absolutely no pixel-level masks are used during training.
  4. Test-Time Adaptation (TTA): The model features a dynamic feedback loop. If a classification prediction is uncertain, the model can backpropagate that uncertainty to refine its internal segmentation, essentially "looking closer" to solidify its recognition.
Illustration of the feed-forward and feedback loops in CAST, where recognition uncertainty drives segmentation refinement.

Key Insights and Results

By forcing a model to organize pixels into parts to support a final classification, hierarchical segmentation emerges naturally. You don't need a billion masks if the model is architecturally incentivized to group related pixels.

Evaluated across major benchmarks (ImageNet, MSCOCO, PartImageNet, ADE20K), CAST demonstrates impressive capabilities:

  • Outperforming SAM: When tested on PartImageNet object segmentation, a CAST model trained on unlabeled images outperformed SAM—which was trained on 11 million images and 1 billion masks—by an absolute 8% in mIoU.
  • Superior Efficiency to ViT: Because the model progressively reduces the number of tokens through pooling, it becomes highly efficient. CAST-S achieved higher accuracy on ImageNet classification while using roughly 30% fewer GFLOPS than a standard ViT-S.
  • Semantic Alignment: Qualitative results show that CAST's unsupervised segments align much more closely with human-defined parts (e.g., separating a "fish head" from a "fish body") compared to other hierarchical methods.
  • Robustness: In semantic segmentation tasks on ADE20K and PASCAL VOC, CAST consistently generalized better than ViT, especially in adhering to complex object contours.

Limitations and Future Work

Currently, CAST's performance is tethered to the quality of the initial superpixel algorithm. In highly cluttered scenes with very thin structures (like light poles or wires in the Cityscapes dataset), off-the-shelf superpixel methods can fail, causing downstream underperformance.

Future work will likely focus on making the superpixel generation itself a learnable, end-to-end component of the neural network rather than a pre-processing step. Additionally, while results on ImageNet-1K are highly promising, testing how this hierarchical, recognition-driven segmentation approach scales to massive "foundation model" sizes remains an exciting open question.

Summary updated

BibTeX
@inproceedings{ke2024learning,
  author = {Tsung-Wei Ke and Sangwoo Mo and Stella X. Yu},
  title = {{Learning Hierarchical Image Segmentation For Recognition and By Recognition}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=IRcv4yFX6z},
}
Figure