Centroid-centered Modeling for Efficient Vision Transformer Pre-training
Xin Yan, Zuchao Li, Lefei Zhang
TL;DR
CCViT introduces a centroid-centered, non-parametric tokenizer for Masked Image Modeling by applying k-means to image patches to produce centroids that function as both patch pixels and token IDs. The framework uses blockwise masking plus centroid replacement and a two-branch ViT backbone to learn both token predictions and pixel reconstructions, optimizing a joint loss L_CIM = L_CE + L_MSE. Empirically, CCViT achieves 84.3% top-1 on ImageNet-1K with ViT-B and 86.0% with ViT-L, and 48.4 mIoU on ADE20K (ViT-B), demonstrating competitive performance without external data; the centroid tokenizer can be constructed in seconds and requires far less resources than parametric tokenizers. Ablation studies show that learning both token and pixel targets and using random replacement improve results, and analyses indicate superior robustness and efficiency of the centroid-based tokenizer compared to BEiT/BEiTv2.
Abstract
Masked Image Modeling (MIM) is a new self-supervised vision pre-training paradigm using a Vision Transformer (ViT). Previous works can be pixel-based or token-based, using original pixels or discrete visual tokens from parametric tokenizer models, respectively. Our proposed centroid-based approach, CCViT, leverages k-means clustering to obtain centroids for image modeling without supervised training of the tokenizer model, which only takes seconds to create. This non-parametric centroid tokenizer only takes seconds to create and is faster for token inference. The centroids can represent both patch pixels and index tokens with the property of local invariance. Specifically, we adopt patch masking and centroid replacing strategies to construct corrupted inputs, and two stacked encoder blocks to predict corrupted patch tokens and reconstruct original patch pixels. Experiments show that our CCViT achieves 84.4% top-1 accuracy on ImageNet-1K classification with ViT-B and 86.0% with ViT-L. We also transfer our pre-trained model to other downstream tasks. Our approach achieves competitive results with recent baselines without external supervision and distillation training from other models.
