CAPI
Masked image modelling that predicts latent patch clusters; a ViT-L/14 encoder from FAIR.
Image classification · 1,555 operations Checked
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
At a glance
- Task
- Image classification
- Parameters
- 453.7M
- Operations
- 1,555
- Framework
- PyTorch
- Recurrent
- No
- Published
- TMLR 2025
- Cited by
- 0 (as of 16 October 2026)
- Authors
- Timothée Darcet, Federico Baldassarre, Maxime Oquab and others
- License
- Apache-2.0
- Checked
- Passed: the trace was replayed operation by operation and matched the model's own output for this input.
Files
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
Details
- Stable ID
- m281
- Graph hash
- ce739920d4a17aff4b2726a6e04ea6453394469bbdd1e5f500c697c6819994bc
- Skeleton hash
- cf3dfcb41b8ddb0908a2ad58ad6ca4b7eddd5f514752975b2c4af008bd732050
- Architecture hash
- 568fdc0882af1a5dd1d7e1c31314537305f2ffe4b0801439008be3ec13f41aa0
- Diagram SHA-256
- 720624d61dca480661ede310022f561fae14d6ee22ab5399a75921dcb079121a
- TorchLens version
- 2.36.0
- Renderer
- graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
- Check
- Forward pass replayed in PyTorch
What it is
CAPI is a self-supervised vision transformer trained purely by masked image modelling, and its trick is to predict cluster assignments of hidden patches rather than pixels or raw features. The clustering-based loss is stable to train and shows promising scaling properties. The ViT-L backbone reaches 83.8% ImageNet accuracy and 32.1% mIoU on ADE20K with simple linear probes, approaching DINOv2.
A teacher encoder, kept as an exponential moving average of the student, sees the full image, and its patch embeddings are turned into soft assignments over pseudo-categories by a learned online clustering. The student receives a partially masked image and is trained to predict the clustering assignments of the missing patches. Reconstruction is handled by a cross-attention predictor kept separate from the encoder, following crossMAE. In a typical training step the encoder sees 69 kept patch tokens plus 16 learnable register tokens.
The released checkpoints are all ViT-L/14 at 302M parameters, pretrained on Places205, LVD-142M, ImageNet-22k or ImageNet-1k. Calling the model on an image returns three things: a global representation, the register tokens and the patch feature map. The code was built on the DINOv2 codebase.
Key idea. Pure masked image modelling where the target is an online clustering of an EMA teacher's patch embeddings, predicted by a separate cross-attention predictor.
- capi
- cluster and predict latent patches
- masked image modeling
- mim
- self-supervised vision transformer
- vit-l/14
- fair
- meta
- dinov2
- latent clustering
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@misc{darcet2025clusterpredictlatentpatches,
title={Cluster and Predict Latent Patches for Improved Masked Image Modeling},
author={Timothée Darcet and Federico Baldassarre and Maxime Oquab and Julien Mairal and Piotr Bojanowski},
year={2025},
eprint={2502.08769},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2502.08769},
}