Introduction
The success of BERT in Natural Language Processing has inspired similar "Masked Modeling" approaches in computer vision, such as BEiT and MAE. These methods pre-train Vision Transformers (ViTs) by masking parts of an image and requiring the model to predict the missing content. However, unlike language, which has a discrete vocabulary of words, images lack a natural set of "visual words."
PeCo (Perceptual Codebook) addresses this by introducing a tokenizer that aligns discrete visual tokens with human perception. By incorporating a perceptual loss into the tokenizer's training, PeCo creates a vocabulary that captures semantic meaning rather than just low-level pixel statistics, leading to state-of-the-art performance across various vision benchmarks.
Bridging the Perceptual Gap
A significant challenge in Masked Image Modeling (MIM) is choosing the right prediction target. Existing methods typically use raw pixels or discrete tokens from a standard VQ-VAE. The authors argue that these targets often suffer from a "perceptual gap." Standard VQ-VAEs are trained using pixel-wise L2 loss, which is a poor proxy for human vision. For instance, a slight spatial shift can result in a high L2 error despite the images looking identical to a human, while a blur might have a low L2 error but be perceptually distinct.
As shown in the figure above, traditional metrics like L2 and even the DALL-E codebook often fail to reflect human similarity judgments. PeCo's perceptual codebook is designed to bridge this gap, ensuring that the "visual words" used for pre-training are semantically consistent.
Methodology: Learning a Perceptual Codebook
The core of PeCo is a VQ-VAE trained with a specialized Perceptual Loss. Instead of relying solely on pixel reconstruction, PeCo ensures that the original and reconstructed images have similar deep features.
- Perceptual Loss: The model minimizes the distance between features extracted from a pre-trained "Perceptual Model."
- Self-Supervised Consistency: To maintain a purely self-supervised pipeline, the authors use a MoCo v3 pre-trained ViT-B as the perceptual teacher, rather than a supervised model like VGG.
- BERT-style Pre-training: After training the tokenizer, a ViT is trained to predict these perceptual tokens for masked image patches, following the standard BERT/BEiT framework.
To mitigate the computational overhead of the tokenizer, the authors also introduced PeCo-lite, a version with reduced channel counts that retains most of the performance benefits.
Experimental Results
PeCo was evaluated on several standard benchmarks, demonstrating superior performance over previous state-of-the-art MIM methods.
ImageNet-1K Classification
Using a ViT-Base backbone, PeCo achieved 84.5% Top-1 accuracy, outperforming BEiT by 1.3% and MAE by 0.9% under similar training conditions. When scaled to a ViT-Huge backbone, PeCo reached 88.3% accuracy using only ImageNet-1K data, setting a new benchmark at the time of publication.
Downstream Tasks
The benefits of perceptual tokens extend to dense prediction tasks:
- ADE20K (Semantic Segmentation): PeCo reached 48.5 mIoU, significantly higher than supervised pre-training (47.4) and BEiT (47.1).
- COCO (Object Detection): PeCo showed consistent improvements in object detection and instance segmentation metrics.
Key Insights
A critical finding is that perceptual loss implicitly forces the codebook to learn semantic concepts. Linear probing on PeCo tokens yielded 29.7% accuracy, nearly triple the 10.2% achieved by standard VQ-VAE tokens. This suggests that the "visual words" in PeCo are much closer to the semantic "words" used in NLP.
While the multi-stage pipeline (tokenizer training followed by ViT pre-training) adds complexity compared to end-to-end methods like MAE, the significant gains in semantic consistency and downstream performance justify the approach. Future work may explore extending this perceptual alignment to multi-modal models to better link visual tokens with linguistic concepts.
Summary updated