Region-Native Visual Tokenization

Meng Wang, Yuyao Huang, Henghui Ding, Xinlong Wang, Tiejun Huang, Yao Zhao, Yunchao Wei, Shuicheng Yan

Abstract

Traditional visual tokenization methods, such as those used in Vision Transformers (ViTs), rely on rigid grid-based patches. This approach often leads to information redundancy and the coupling of semantic features across patch boundaries. We introduce REader (REgion-native AutoencoDER), a novel framework that adaptively partitions images into arbitrary-shaped regions based on semantic content. By representing images through their constituent objects and parts, REader achieves superior reconstruction fidelity with significantly fewer tokens while facilitating precise, local image editing.

Introduction: The Limitations of Grid-Based Tokenization

Most modern computer vision models process images by slicing them into a fixed grid of square patches. This conventional approach suffers from two primary drawbacks. First, it creates information redundancy; simple areas (like a clear sky) and complex textures are allocated the same number of tokens, wasting computational resources. Second, it results in coupled information. Because grid lines do not follow natural object boundaries, a single object is often split across multiple tokens, and a single token may contain parts of multiple objects. This coupling makes local image editing—such as modifying a facial expression or removing an object—extremely difficult without introducing global artifacts.

REader adaptively partitions images into semantic regions, avoiding the pitfalls of rigid grids.

Methods: The REader Architecture

The REader framework consists of four primary stages designed to move from pixels to semantic tokens and back:

  1. Encoder: A standard ViT backbone paired with a Feature Pyramid Network (FPN) extracts multi-scale features from the input image.
  2. Region Partitioning: A Transformer-based region decoder utilizes learnable "region queries" to generate a similarity matrix against image features. An argmax operation assigns each pixel to a specific region. This process is adaptive; in simpler images, fewer queries are utilized, resulting in a dynamic, content-dependent token count.
  3. Region Embedder: This module fuses geometric information (the region's binary mask) with visual features into a single token. The process remains end-to-end differentiable via the "straight-through trick."
  4. Decoder: A cross-attention-based decoder uses learnable patch queries to probe the region tokens and reconstruct the original image pixels.

To ensure semantic meaningfulness, the partitioning process is supervised during training using pseudo-labels from the Segment Anything Model (SAM) or manual annotations.

Key Results and Insights

REader was evaluated on ImageNet for general reconstruction and CelebAMask-HQ for specialized facial editing tasks.

Superior Reconstruction and Efficiency

On ImageNet, REader achieved a PSNR of 24.75 and an rFID of 2.43 using an average of only 79.09 tokens. In contrast, the widely used VQGAN requires 256 or 1024 tokens to achieve significantly lower fidelity (rFID scores of 8.05 and 4.92, respectively). This demonstrates that arbitrarily shaped regions are fundamentally more efficient than square patches for visual representation.

State-of-the-Art Local Editing

The inherent disentanglement of region tokens allows for precise local editing. By modifying or deleting specific tokens and their associated masks, users can perform complex edits without affecting the rest of the image. In "smile transferring" benchmarks on CelebAMask-HQ, REader outperformed specialized GAN-based models like MaskGAN and EditGAN, achieving the best FID (37.91) and ID Score (0.8470).

Examples of local image editing, including object removal, shape modification, and facial expression adjustment.

Conclusion

REader represents a shift toward semantic-aware visual tokenization. By respecting natural boundaries, the model avoids aliasing and information leakage common in grid-based methods. While current limitations include potential blurring at high resolutions and a dependency on external mask supervision, future work aims to scale the architecture and explore self-supervised region discovery. REader holds significant potential as a backbone for next-generation large-scale multimodal models (LMMs).

Summary updated

BibTeX
@inproceedings{wang2024region,
  author = {Meng Wang and Yuyao Huang and Henghui Ding and Xinlong Wang and Tiejun Huang and Yao Zhao and Yunchao Wei and Shuicheng Yan},
  title = {{Region-Native Visual Tokenization}},
  booktitle = {European Conference on Computer Vision},
  year = {2024},
  doi = {10.1007/978-3-031-72904-1\_2},
}
Figure