dinov2_with_registers (image classification)
A Vision Transformer with extra register tokens in its input sequence, here with an image classification head.
Image classification · 331 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
- 85.8M
- Operations
- 331
- Framework
- PyTorch
- Recurrent
- No
- Published
- 2023
- Source
- transformers 5.18.0
- Name in source
- dinov2_with_registers:image-classification
- 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
- m4315
- Graph hash
- d6b3a378d706779cb3f4637f18115555c56b3f21af01e54c60003dea182ea704
- Skeleton hash
- abca70d57ba513bdbaaa2b14c3e7789034bda804adad2f07eeb89d9d47a218b9
- Architecture hash
- 94b2b23944f9d22207e0960f48ff3c406a03d1eae3231ecaf1959c0c90775170
- Diagram SHA-256
- b281e3cdad408a4bdfc4b7605f93a457b5b618df513358e9bb46286e6278d74b
- TorchLens version
- 2.35.3
- Renderer
- graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
- Check
- Forward pass replayed in PyTorch
How this diagram was made
transformers.AutoModelForImageClassification.from_config()
What it is
DINOv2 with Registers is a Vision Transformer (ViT) that is given additional tokens, called register tokens, in its input sequence. It was proposed in the paper Vision Transformers Need Registers. The ViT it starts from is a transformer encoder model, BERT-like, first introduced for supervised image classification on ImageNet.
The paper identifies artifacts in the feature maps of both supervised and self-supervised ViT networks. The artifacts are high-norm tokens that appear during inference mainly in low-informative background areas of images and are repurposed for internal computations. The added tokens are there to take over that role. The paper reports that this leads to smoother feature maps and attention maps for downstream visual processing. Using the model is identical to using DINOv2 without registers.
Key idea. The paper shows that adding extra tokens to the input sequence of a Vision Transformer fixes high-norm artifact tokens in the feature maps of supervised and self-supervised models.
- dinov2 with registers
- dinov2-with-registers
- dinov2 registers
- vision transformers need registers
- register tokens
- vit registers
- attention map artifacts
- self-supervised vision transformer
- image classification
AI-written summary, based on the model's documentation and checked automatically against it; not reviewed by a person. Corrections welcome.