<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Michał Chromiak's blog - Self-Supervision</title><link href="https://mchromiak.github.io/" rel="alternate"/><link href="/feeds/self-supervision.atom.xml" rel="self"/><id>https://mchromiak.github.io/</id><updated>2023-06-17T14:43:00+02:00</updated><subtitle>Be a fool to become a Polymath.</subtitle><entry><title>I-JEPA: Learning from images by predicting missing features</title><link href="https://mchromiak.github.io/articles/2023/Jun/17/Self-Supervised-Learning-from-Images-with-a-Joint-Embedding-Predictive-Architecture/" rel="alternate"/><published>2023-06-17T14:43:00+02:00</published><updated>2023-06-17T14:43:00+02:00</updated><author><name>Michał Chromiak</name></author><id>tag:mchromiak.github.io,2023-06-17:/articles/2023/Jun/17/Self-Supervised-Learning-from-Images-with-a-Joint-Embedding-Predictive-Architecture/</id><summary type="html">&lt;p&gt;I-JEPA learns visual features by predicting the representations of hidden image regions, rather than reconstructing their pixels. This guide explains the context encoder, target encoder, predictor, and masking strategy, then examines what the paper's accuracy and efficiency results actually measure.&lt;/p&gt;</summary><content type="html">&lt;p&gt;Imagine covering the head of a dog in a photograph. The visible body and surroundings give you clues about the hidden region. You may infer its shape and position without knowing the exact color of every pixel.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;I-JEPA turns that distinction into a learning task: predict useful features of a hidden region, rather than draw the missing pixels.&lt;/strong&gt; It learns from images without requiring class labels during pretraining. Afterward, its features can serve as inputs to models for tasks such as classification.&lt;/p&gt;
&lt;p&gt;The name stands for &lt;em&gt;Image-based Joint-Embedding Predictive Architecture&lt;/em&gt;. Mahmoud Assran and colleagues introduced the method in a &lt;a href="https://arxiv.org/abs/2301.08243"&gt;paper first submitted in January 2023&lt;/a&gt;, later published at &lt;a href="https://openaccess.thecvf.com/content/CVPR2023/html/Assran_Self-Supervised_Learning_From_Images_With_a_Joint-Embedding_Predictive_Architecture_CVPR_2023_paper.html"&gt;CVPR 2023&lt;/a&gt;. Meta released the code and checkpoints in June. This article follows the paper's &lt;a href="https://arxiv.org/html/2301.08243v3"&gt;April 2023 revision&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="what-is-a-feature-if-it-is-not-a-pixel"&gt;What is a feature, if it is not a pixel?&lt;a class="headerlink" href="#what-is-a-feature-if-it-is-not-a-pixel" title="Permanent link"&gt;🔗&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A pixel records color at a particular location. An &lt;strong&gt;encoder&lt;/strong&gt; is a neural network that transforms pixels into an &lt;strong&gt;embedding&lt;/strong&gt;, a vector of learned numbers. Those numbers can make relationships between images easier to recognize: which shapes belong together, which regions look alike, or how an object relates to its surroundings.&lt;/p&gt;
&lt;p&gt;An embedding is not a written description. I-JEPA does not receive a label such as "dog's head" for the hidden region, and no one assigns that meaning to a particular coordinate of its output. The training task shapes the representation; downstream evaluations test whether useful information has emerged.&lt;/p&gt;
&lt;p&gt;Why predict embeddings? Reconstructing pixels rewards getting every visible detail right. A representation-learning task may benefit more from retaining object structure than from reproducing the exact texture of grass. I-JEPA lets a learned encoder provide the prediction targets instead of fixing those targets to raw pixels.&lt;/p&gt;
&lt;p&gt;That choice alone is not enough. The model also needs a prediction problem that encourages it to use meaningful context. The architecture and the masks work together to create one.&lt;/p&gt;
&lt;h2 id="follow-one-image-through-i-jepa"&gt;Follow one image through I-JEPA&lt;a class="headerlink" href="#follow-one-image-through-i-jepa" title="Permanent link"&gt;🔗&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;I-JEPA divides an image into a grid of &lt;strong&gt;patches&lt;/strong&gt;, small non-overlapping squares. Its encoders use Vision Transformers, which process these patches as a sequence and allow information to move between them through attention.&lt;/p&gt;
&lt;p&gt;There are three networks with different jobs:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;The context encoder reads the visible patches.&lt;/strong&gt; Some regions are withheld. The encoder produces features for the patches it is allowed to see.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The target encoder reads the complete image.&lt;/strong&gt; It produces one representation per patch. The training targets are selected from these outputs at the locations of the withheld regions.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The predictor fills in the missing features.&lt;/strong&gt; It receives the context features and position information telling it which region to predict. Its output is compared with the corresponding target-encoder features.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;a href="https://mchromiak.github.io/articles/2023/Jun/17/img/I-JEPA.png"&gt;&lt;img alt="I-JEPA training diagram: a context encoder processes visible patches, a shared predictor makes feature predictions at colored target positions, and a target encoder processes the complete image to provide the comparison targets." src="https://mchromiak.github.io/articles/2023/Jun/17/img/I-JEPA.png"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p align="center"&gt;Figure 1. The I-JEPA training architecture, from the paper's &lt;a href="https://arxiv.org/html/2301.08243v3#S3.F3"&gt;figure 3&lt;/a&gt;. Matching colors identify the same target region in the two branches. The repeated predictor boxes share their weights; they are not separately trained models.&lt;/p&gt;
&lt;p&gt;The order of operations matters. &lt;strong&gt;Target regions are selected after the target encoder has processed the complete image.&lt;/strong&gt; A target feature can therefore incorporate information from elsewhere in that image. The context encoder, by contrast, never receives the hidden target patches as input.&lt;/p&gt;
&lt;p&gt;The predictor also needs to know &lt;em&gt;where&lt;/em&gt; to predict. Otherwise, the same visible context could be used to ask about several different missing regions. I-JEPA supplies a shared learnable mask token at each requested position, with a positional embedding added to it. These tokens specify locations; they do not reveal the missing pixels. &lt;a href="https://arxiv.org/html/2301.08243v3#S3"&gt;Paper, section 3&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id="how-the-networks-learn-together"&gt;How the networks learn together&lt;a class="headerlink" href="#how-the-networks-learn-together" title="Permanent link"&gt;🔗&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;The prediction error updates the &lt;strong&gt;context encoder and predictor&lt;/strong&gt; through backpropagation. The &lt;strong&gt;target encoder&lt;/strong&gt; is updated differently: its weights track an exponential moving average of the context encoder's weights.&lt;/p&gt;
&lt;p&gt;Think of the target encoder as a slowly changing reference. Each update retains most of its previous weights and adds a small contribution from the newly trained context encoder. The targets improve as training progresses, but do not chase each individual gradient update directly.&lt;/p&gt;
&lt;p&gt;This design addresses a risk called &lt;strong&gt;representation collapse&lt;/strong&gt;. If every image produced the same vector, predicting that vector would be easy, but the representation would be useless. I-JEPA uses the asymmetry between the two branches, the predictor, and the moving-average target encoder to train without explicit negative-image pairs. The paper reports that the moving-average encoder is essential in its experiments; averaging alone is not a general mathematical guarantee against collapse.&lt;/p&gt;
&lt;h2 id="why-the-mask-is-part-of-the-method"&gt;Why the mask is part of the method&lt;a class="headerlink" href="#why-the-mask-is-part-of-the-method" title="Permanent link"&gt;🔗&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Hiding a few isolated pixels can create a task solvable from nearby color and texture. Hiding almost everything can leave too little evidence to make a useful prediction. I-JEPA instead samples several substantial target regions while keeping context distributed around them.&lt;/p&gt;
&lt;p&gt;Its default recipe is:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Sample &lt;strong&gt;four target blocks&lt;/strong&gt;, each covering roughly 15-20% of the image area, with aspect ratios between 0.75 and 1.5. Target blocks may overlap one another.&lt;/li&gt;
&lt;li&gt;Sample a square &lt;strong&gt;context block&lt;/strong&gt; covering roughly 85-100% of the image area.&lt;/li&gt;
&lt;li&gt;Remove from the context every patch that overlaps any target block.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The 85-100% figure describes the context block &lt;strong&gt;before&lt;/strong&gt; those removals. It is not the fraction of image patches actually passed to the context encoder. The remaining context can have several holes and be much sparser. Likewise, four 20% targets do not necessarily hide 80% of the image, because targets can overlap.&lt;/p&gt;
&lt;p&gt;This gives the predictor a different problem from reconstructing scattered pixels: use evidence from visible regions to infer features across several larger missing regions. The paper's masking ablations show that replacing this strategy with random patches or simple quadrants sharply reduces performance in the tested low-label linear-probe setting. &lt;a href="https://arxiv.org/html/2301.08243v3#S3.F4"&gt;Paper, figure 4&lt;/a&gt; and &lt;a href="https://arxiv.org/html/2301.08243v3#S7.T6"&gt;table 6&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id="does-no-hand-crafted-augmentations-mean-no-cropping"&gt;Does "no hand-crafted augmentations" mean no cropping?&lt;a class="headerlink" href="#does-no-hand-crafted-augmentations-mean-no-cropping" title="Permanent link"&gt;🔗&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;No. Here the distinction is between constructing multiple transformed views whose representations must agree and constructing a context-to-target prediction task within one image view.&lt;/p&gt;
&lt;p&gt;The official I-JEPA pretraining configuration still uses &lt;strong&gt;random resized cropping and normalization&lt;/strong&gt;. Its default recipe disables color distortion, Gaussian blur, and horizontal flipping. The masks themselves are also deliberate design choices. I-JEPA reduces reliance on the multi-view augmentation recipe used by methods such as DINO; it does not eliminate preprocessing or all assumptions about images. &lt;a href="https://github.com/facebookresearch/ijepa/blob/main/src/transforms.py"&gt;Official transforms&lt;/a&gt;, &lt;a href="https://github.com/facebookresearch/ijepa/blob/main/configs/in1k_vith14_ep300.yaml"&gt;ViT-H/14 configuration&lt;/a&gt;.&lt;/p&gt;
&lt;details class="dinov2-background"&gt;
&lt;summary&gt;The prediction objective, with the paper's notation&lt;/summary&gt;
&lt;p&gt;Let &lt;span class="math"&gt;\(M\)&lt;/span&gt; be the number of target blocks, normally four. For block &lt;span class="math"&gt;\(i\)&lt;/span&gt;, &lt;span class="math"&gt;\(B_i\)&lt;/span&gt; is the set of patch positions inside that block. The vector &lt;span class="math"&gt;\(\boldsymbol{s}_{y_j}\)&lt;/span&gt; is the target encoder's output for patch &lt;span class="math"&gt;\(j\)&lt;/span&gt;; &lt;span class="math"&gt;\(\hat{\boldsymbol{s}}_{y_j}\)&lt;/span&gt; is the predictor's estimate. The collections of vectors for a whole block are written &lt;span class="math"&gt;\(\boldsymbol{s}_y(i)\)&lt;/span&gt; and &lt;span class="math"&gt;\(\hat{\boldsymbol{s}}_y(i)\)&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;Section 3 writes the objective as follows, with the equality split across two lines here for readability:&lt;/p&gt;
&lt;p&gt;
&lt;div class="math"&gt;$$
\begin{aligned}
&amp;amp;\frac{1}{M}\sum_{i=1}^{M} D\left(\hat{\boldsymbol{s}}_y(i),\boldsymbol{s}_y(i)\right)\\
&amp;amp;\qquad=\frac{1}{M}\sum_{i=1}^{M}\sum_{j\in B_i}
\left\lVert\hat{\boldsymbol{s}}_{y_j}-\boldsymbol{s}_{y_j}\right\rVert_2^2.
\end{aligned}
$$&lt;/div&gt;
&lt;/p&gt;
&lt;p&gt;Read the right-hand side from the inside out: take the difference between the predicted and target vectors, compute its squared Euclidean length, sum over the patches in a block, then average across the &lt;span class="math"&gt;\(M\)&lt;/span&gt; blocks. The paper's displayed expression has a block average and a patch sum; it does not include a separate division by the number of patches in each block.&lt;/p&gt;
&lt;p&gt;The context encoder has parameters &lt;span class="math"&gt;\(\theta\)&lt;/span&gt;, the predictor has parameters &lt;span class="math"&gt;\(\phi\)&lt;/span&gt;, and the target encoder has parameters &lt;span class="math"&gt;\(\bar{\theta}\)&lt;/span&gt;. Only &lt;span class="math"&gt;\(\theta\)&lt;/span&gt; and &lt;span class="math"&gt;\(\phi\)&lt;/span&gt; receive gradients from this objective. The moving-average update can be written as:&lt;/p&gt;
&lt;p&gt;
&lt;div class="math"&gt;$$
\bar{\theta}\leftarrow m\bar{\theta}+(1-m)\theta.
$$&lt;/div&gt;
&lt;/p&gt;
&lt;p&gt;This last equation spells out the update described in the paper's prose. The momentum &lt;span class="math"&gt;\(m\)&lt;/span&gt; starts at 0.996 and increases toward 1 during pretraining. A larger value retains more of the target encoder's previous weights. &lt;a href="https://arxiv.org/html/2301.08243v3#S3"&gt;Paper, section 3&lt;/a&gt; and &lt;a href="https://arxiv.org/html/2301.08243v3#A1.SS1"&gt;appendix A.1&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Paper versus implementation:&lt;/strong&gt; the released training code normalizes target features and uses &lt;code&gt;smooth_l1_loss&lt;/code&gt; with its default mean reduction, rather than the squared-L2 expression printed above. Both train feature prediction, but they are different numerical losses. The equation here follows the paper; reproducing the released checkpoints requires following the &lt;a href="https://github.com/facebookresearch/ijepa/blob/main/src/train.py"&gt;implementation&lt;/a&gt;.&lt;/p&gt;
&lt;/details&gt;
&lt;h2 id="how-it-differs-from-mae-and-dino"&gt;How it differs from MAE and DINO&lt;a class="headerlink" href="#how-it-differs-from-mae-and-dino" title="Permanent link"&gt;🔗&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;All three methods learn from images without needing class labels during pretraining. What changes is the training question.&lt;/p&gt;
&lt;div class="table-responsive"&gt;
&lt;table class="table table-striped"&gt;
&lt;thead&gt;&lt;tr&gt;&lt;th scope="col"&gt;Method&lt;/th&gt;&lt;th scope="col"&gt;Training question&lt;/th&gt;&lt;th scope="col"&gt;Prediction target&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;MAE&lt;/td&gt;&lt;td&gt;Can visible patches reconstruct the missing patches?&lt;/td&gt;&lt;td&gt;Pixel values, typically normalized within each patch&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;DINO&lt;/td&gt;&lt;td&gt;Can a student match its teacher across different augmented views?&lt;/td&gt;&lt;td&gt;The teacher's output distribution over learned features&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;I-JEPA&lt;/td&gt;&lt;td&gt;Can visible context predict features at specified hidden positions?&lt;/td&gt;&lt;td&gt;Patch representations from the moving-average target encoder&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;

&lt;p&gt;&lt;a href="https://mchromiak.github.io/articles/2023/Jun/17/Self-Supervised-Learning-from-Images-with-a-Joint-Embedding-Predictive-Architecture/img/i-JEPA_architecture.png"&gt;&lt;img alt="Three self-supervised architecture families: joint embedding compares encoded inputs; a generative architecture decodes a signal; a joint-embedding predictive architecture predicts an encoded target." src="https://mchromiak.github.io/articles/2023/Jun/17/Self-Supervised-Learning-from-Images-with-a-Joint-Embedding-Predictive-Architecture/img/i-JEPA_architecture.png"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p align="center"&gt;Figure 2. The paper's &lt;a href="https://arxiv.org/html/2301.08243v3#S0.F2"&gt;figure 2&lt;/a&gt; compares architecture families. In the right-hand panel, the predictor estimates a target representation rather than a target image. For I-JEPA, the conditioning information marked &lt;span class="math"&gt;\(z\)&lt;/span&gt; specifies the positions to predict.&lt;/p&gt;
&lt;p&gt;The middle and right panels make the central difference visible: &lt;strong&gt;a decoder predicts the signal; I-JEPA's predictor predicts its representation&lt;/strong&gt;. A useful representation need not preserve every detail that a pixel reconstruction requires.&lt;/p&gt;
&lt;p&gt;For the reconstruction side of this comparison, see the &lt;a href="https://mchromiak.github.io/articles/2021/Nov/14/Masked-Autoencoders-Are-Scalable-Vision-Learners/"&gt;MAE article&lt;/a&gt;. The &lt;a href="https://mchromiak.github.io/articles/2021/May/03/DINO-Emerging-Properties-in-Self-Supervised-Vision-Transformers/"&gt;DINO article&lt;/a&gt; explains the teacher-student, multi-view approach.&lt;/p&gt;
&lt;h2 id="what-happens-after-pretraining"&gt;What happens after pretraining?&lt;a class="headerlink" href="#what-happens-after-pretraining" title="Permanent link"&gt;🔗&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Pretraining produces features, not a ready-made classifier for every task. To evaluate those features, the paper uses the &lt;strong&gt;target encoder&lt;/strong&gt;, generally averaging its patch representations into an image-level vector.&lt;/p&gt;
&lt;p&gt;A &lt;strong&gt;linear probe&lt;/strong&gt; keeps the encoder frozen and trains a simple classifier on top of its features. This asks whether the representation already makes categories easy to separate. Labels are used to train that classifier, even though they were not used to pretrain the encoder.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Fine-tuning&lt;/strong&gt; also updates the encoder for the downstream task. It can adapt the representation more extensively, but answers a different question from linear probing. Keeping these protocols separate makes the results much easier to interpret.&lt;/p&gt;
&lt;h3 id="classification-useful-features-with-fewer-pretraining-epochs"&gt;Classification: useful features with fewer pretraining epochs&lt;a class="headerlink" href="#classification-useful-features-with-fewer-pretraining-epochs" title="Permanent link"&gt;🔗&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;The following results are from the paper's full-label ImageNet-1K &lt;strong&gt;linear evaluation&lt;/strong&gt;, where top-1 accuracy is the percentage of images assigned the correct highest-scoring class:&lt;/p&gt;
&lt;div class="table-responsive"&gt;
&lt;table class="table table-striped"&gt;
&lt;thead&gt;&lt;tr&gt;&lt;th scope="col"&gt;Method and encoder&lt;/th&gt;&lt;th scope="col"&gt;Pretraining epochs&lt;/th&gt;&lt;th scope="col"&gt;Top-1 accuracy&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;MAE, ViT-H/14&lt;/td&gt;&lt;td&gt;1,600&lt;/td&gt;&lt;td&gt;77.2%&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;I-JEPA, ViT-H/14&lt;/td&gt;&lt;td&gt;300&lt;/td&gt;&lt;td&gt;79.3%&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;I-JEPA, ViT-H/16 at 448-pixel resolution&lt;/td&gt;&lt;td&gt;300&lt;/td&gt;&lt;td&gt;81.1%&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;

&lt;p&gt;An epoch is one pass through the training dataset. ViT-H denotes the Huge model; &lt;code&gt;/14&lt;/code&gt; and &lt;code&gt;/16&lt;/code&gt; denote the patch width in pixels. The higher-resolution row processes a different patch grid, so it is not the same computation as the standard ViT-H/14 run.&lt;/p&gt;
&lt;p&gt;The matched ViT-H/14 comparison is the clearest result: I-JEPA reaches higher linear-probe accuracy after substantially fewer pretraining epochs. That does not make it the winner over every model in the table: DINO's different ViT-B/8 configuration reaches 80.1%. &lt;a href="https://arxiv.org/html/2301.08243v3#S4.T1"&gt;Paper, table 1&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id="low-label-learning-and-spatial-information"&gt;Low-label learning and spatial information&lt;a class="headerlink" href="#low-label-learning-and-spatial-information" title="Permanent link"&gt;🔗&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;With only &lt;strong&gt;1% of ImageNet's labels&lt;/strong&gt;, I-JEPA's ViT-H/14 reaches 73.3% accuracy, compared with 71.5% for MAE's ViT-H/14. This is a separate experiment: the I-JEPA encoder is fine-tuned, not frozen. The 448-pixel I-JEPA variant reaches 77.3%. These results support label-efficient adaptation, not a claim that all downstream tasks need no fine-tuning. &lt;a href="https://arxiv.org/html/2301.08243v3#S5.T2"&gt;Paper, table 2&lt;/a&gt; and &lt;a href="https://arxiv.org/html/2301.08243v3#A1.SS2"&gt;appendix A.2&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The paper also tests frozen features on CLEVR, a dataset of synthetic scenes. Its counting and distance tasks check whether the representation retains information beyond object category. I-JEPA scores 86.7 on counting and 72.4 on the distance task; MAE scores 90.5 and 72.4 respectively. I-JEPA therefore retains useful spatial information, but does not surpass MAE on both tasks. These benchmarks should not be read as a demonstration of dense, real-world depth maps. &lt;a href="https://arxiv.org/html/2301.08243v3#S6.T4"&gt;Paper, table 4&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="where-the-compute-savings-come-from"&gt;Where the compute savings come from&lt;a class="headerlink" href="#where-the-compute-savings-come-from" title="Permanent link"&gt;🔗&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Meta reports training the approximately &lt;strong&gt;632-million-parameter ViT-H/14 on 16 A100 GPUs in under 72 hours&lt;/strong&gt;. That is elapsed time for a multi-GPU run, not a single-GPU training budget. At 72 hours, 16 GPUs would account for 1,152 GPU-hours. &lt;a href="https://ai.meta.com/blog/yann-lecun-ai-model-i-jepa/"&gt;Meta's June 2023 announcement&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The efficiency comes from several places. The context encoder processes only visible patches. The predictor is narrower than the encoders. The target encoder processes one complete image view rather than a collection of separately augmented views. Most importantly, useful features emerge after fewer pretraining iterations in the reported comparisons.&lt;/p&gt;
&lt;p&gt;There is still a cost to generating targets. Section 7 reports that an I-JEPA iteration is about 7% slower than the compared MAE setup; the saving comes from needing fewer iterations. The introduction reports more than a tenfold GPU-hour advantage over its ViT-H/14 MAE reference. That is a comparison of the reported training runs, not a universal tenfold speedup for any model or dataset. &lt;a href="https://arxiv.org/html/2301.08243v3#S1"&gt;Paper, section 1&lt;/a&gt; and &lt;a href="https://arxiv.org/html/2301.08243v3#S7"&gt;section 7&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The distinction is practical: making each training step cheaper and needing fewer steps are different routes to reducing the total bill.&lt;/p&gt;
&lt;h2 id="what-does-it-mean-to-learn-a-world-model"&gt;What does it mean to learn a "world model"?&lt;a class="headerlink" href="#what-does-it-mean-to-learn-a-world-model" title="Permanent link"&gt;🔗&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Predicting a hidden region requires learning regularities: which parts tend to occur together, how shapes continue, and what the surrounding image makes plausible. That is the motivation behind connecting I-JEPA to learning through observation.&lt;/p&gt;
&lt;p&gt;The evidence here is about &lt;strong&gt;spatial relationships in still images&lt;/strong&gt;. I-JEPA does not learn action-conditioned future states, plan a sequence of actions, or demonstrate general common-sense reasoning. The authors describe the predictor as a restricted kind of world model, not a completed model of how the physical world works.&lt;/p&gt;
&lt;p&gt;The image-completion visualizations need one further distinction. I-JEPA itself outputs vectors. To make those vectors visible, the researchers freeze the pretrained model and train a &lt;strong&gt;separate generative decoder&lt;/strong&gt; to produce image samples from the predictor's representations. Structure shared across samples suggests what the representation captures; varying texture shows details it leaves unspecified. Those pictures are a diagnostic tool, not evidence that I-JEPA was trained to generate images. &lt;a href="https://arxiv.org/html/2301.08243v3#S8"&gt;Paper, section 8&lt;/a&gt;, &lt;a href="https://github.com/facebookresearch/ijepa#visualizations"&gt;official visualizations&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="the-takeaway"&gt;The takeaway&lt;a class="headerlink" href="#the-takeaway" title="Permanent link"&gt;🔗&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;I-JEPA changes both &lt;strong&gt;what the model predicts&lt;/strong&gt; and &lt;strong&gt;what it must use to make the prediction&lt;/strong&gt;. A learned target encoder supplies feature-space targets, while large missing regions and distributed context make the prediction task informative.&lt;/p&gt;
&lt;p&gt;The result is a way to learn reusable visual features without pixel reconstruction or an elaborate multi-view augmentation recipe. The paper's strongest evidence is the quality of those features under clearly defined evaluations, together with the training effort needed to obtain them.&lt;/p&gt;
&lt;h2 id="related-reading"&gt;Related reading&lt;a class="headerlink" href="#related-reading" title="Permanent link"&gt;🔗&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;I-JEPA addresses learning representations from unlabeled images. For a different stage of the machine-learning workflow, the &lt;a href="https://mchromiak.github.io/articles/2023/May/26/QLoRA-Efficient-Finetuning-of-Quantized-LLMs/"&gt;QLoRA article&lt;/a&gt; explains how to adapt an already pretrained language model using less GPU memory. The two articles explore different efficiency questions: learning useful features versus making task-specific fine-tuning more affordable.&lt;/p&gt;
&lt;h2 id="original-sources"&gt;Original sources&lt;a class="headerlink" href="#original-sources" title="Permanent link"&gt;🔗&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Assran et al., &lt;a href="https://arxiv.org/abs/2301.08243"&gt;Self-Supervised Learning from Images with a Joint-Embedding Predictive Architecture&lt;/a&gt;, CVPR 2023. The method, equations, and tables discussed here follow &lt;a href="https://arxiv.org/html/2301.08243v3"&gt;arXiv version 3&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/facebookresearch/ijepa"&gt;Official I-JEPA repository&lt;/a&gt;, with training code, configurations, and pretrained checkpoints.&lt;/li&gt;
&lt;li&gt;Meta's &lt;a href="https://ai.meta.com/blog/yann-lecun-ai-model-i-jepa/"&gt;June 13, 2023 announcement&lt;/a&gt;, which places the work in the broader JEPA research program.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Both figures are reproduced from Assran et al.'s paper and retain their original content.&lt;/p&gt;
&lt;script type="text/javascript"&gt;if (!document.getElementById('mathjaxscript_pelican_#%@#$@#')) {
    var align = "center",
        indent = "0em",
        linebreak = "false";

    if (false) {
        align = (screen.width &lt; 768) ? "left" : align;
        indent = (screen.width &lt; 768) ? "0em" : indent;
        linebreak = (screen.width &lt; 768) ? 'true' : linebreak;
    }

    var mathjaxscript = document.createElement('script');
    mathjaxscript.id = 'mathjaxscript_pelican_#%@#$@#';
    mathjaxscript.type = 'text/javascript';
    mathjaxscript.src = 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.3/latest.js?config=TeX-AMS-MML_HTMLorMML';

    var configscript = document.createElement('script');
    configscript.type = 'text/x-mathjax-config';
    configscript[(window.opera ? "innerHTML" : "text")] =
        "MathJax.Hub.Config({" +
        "    config: ['MMLorHTML.js']," +
        "    TeX: { extensions: ['AMSmath.js','AMSsymbols.js','noErrors.js','noUndefined.js'], equationNumbers: { autoNumber: 'none' } }," +
        "    jax: ['input/TeX','input/MathML','output/HTML-CSS']," +
        "    extensions: ['tex2jax.js','mml2jax.js','MathMenu.js','MathZoom.js']," +
        "    displayAlign: '"+ align +"'," +
        "    displayIndent: '"+ indent +"'," +
        "    showMathMenu: true," +
        "    messageStyle: 'normal'," +
        "    tex2jax: { " +
        "        inlineMath: [ ['\\\\(','\\\\)'] ], " +
        "        displayMath: [ ['$$','$$'] ]," +
        "        processEscapes: true," +
        "        preview: 'TeX'," +
        "    }, " +
        "    'HTML-CSS': { " +
        "        availableFonts: ['STIX', 'TeX']," +
        "        preferredFont: 'STIX'," +
        "        styles: { '.MathJax_Display, .MathJax .mo, .MathJax .mi, .MathJax .mn': {color: 'inherit ! important'} }," +
        "        linebreaks: { automatic: "+ linebreak +", width: '90% container' }," +
        "    }, " +
        "}); " +
        "if ('default' !== 'default') {" +
            "MathJax.Hub.Register.StartupHook('HTML-CSS Jax Ready',function () {" +
                "var VARIANT = MathJax.OutputJax['HTML-CSS'].FONTDATA.VARIANT;" +
                "VARIANT['normal'].fonts.unshift('MathJax_default');" +
                "VARIANT['bold'].fonts.unshift('MathJax_default-bold');" +
                "VARIANT['italic'].fonts.unshift('MathJax_default-italic');" +
                "VARIANT['-tex-mathit'].fonts.unshift('MathJax_default-italic');" +
            "});" +
            "MathJax.Hub.Register.StartupHook('SVG Jax Ready',function () {" +
                "var VARIANT = MathJax.OutputJax.SVG.FONTDATA.VARIANT;" +
                "VARIANT['normal'].fonts.unshift('MathJax_default');" +
                "VARIANT['bold'].fonts.unshift('MathJax_default-bold');" +
                "VARIANT['italic'].fonts.unshift('MathJax_default-italic');" +
                "VARIANT['-tex-mathit'].fonts.unshift('MathJax_default-italic');" +
            "});" +
        "}";

    (document.body || document.getElementsByTagName('head')[0]).appendChild(configscript);
    (document.body || document.getElementsByTagName('head')[0]).appendChild(mathjaxscript);
}
&lt;/script&gt;</content><category term="Self-Supervision"/><category term="SSL"/><category term="CV"/><category term="Optimization"/><category term="MAE"/><category term="I-JEPA"/><category term="MetaAI"/></entry><entry><title>🦖 DINO: Self-supervised ViTs learn strong features and semantic structure</title><link href="https://mchromiak.github.io/articles/2021/May/03/DINO-Emerging-Properties-in-Self-Supervised-Vision-Transformers/" rel="alternate"/><published>2021-05-03T17:44:00+02:00</published><updated>2021-06-14T17:44:00+02:00</updated><author><name>Michał Chromiak</name></author><id>tag:mchromiak.github.io,2021-05-03:/articles/2021/May/03/DINO-Emerging-Properties-in-Self-Supervised-Vision-Transformers/</id><summary type="html">&lt;p&gt;Self-distillation with no labels (DINO) trains a student network to match an exponential-moving-average teacher across differently augmented views of the same image. Applied to Vision Transformers, it produces features that perform strongly with simple linear and k-nearest-neighbor classifiers. Its final-layer self-attention also reveals object boundaries without segmentation labels, although DINO is not itself a segmentation model.&lt;/p&gt;</summary><content type="html">&lt;h4 id="the-dino-paper-explained"&gt;The DINO paper explained&lt;a class="headerlink" href="#the-dino-paper-explained" title="Permanent link"&gt;🔗&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;This article reviews &lt;strong&gt;&lt;a href="https://openaccess.thecvf.com/content/ICCV2021/html/Caron_Emerging_Properties_in_Self-Supervised_Vision_Transformers_ICCV_2021_paper.html"&gt;Emerging Properties in Self-Supervised Vision Transformers&lt;/a&gt;&lt;/strong&gt; by Caron et al., published at ICCV 2021.&lt;/p&gt;
&lt;p&gt;DINO stands for self-&lt;strong&gt;DI&lt;/strong&gt;stillation with &lt;strong&gt;NO&lt;/strong&gt; labels. It is a self-supervised representation-learning method: it learns from images without human-provided class labels. A student network is optimized by gradient descent to match a teacher network's output for another view of the same image. The teacher has the same architecture but is not trained by backpropagation; its weights are an exponential moving average (EMA) of the student's weights.&lt;/p&gt;
&lt;p&gt;The method works with both convolutional networks and Vision Transformers (ViTs), but the paper's most interesting findings concern ViTs. DINO-trained ViTs provide strong image-level features and final-layer self-attention maps that often align with foreground objects and their boundaries.&lt;/p&gt;
&lt;h4 id="tldr"&gt;TL;DR&lt;a class="headerlink" href="#tldr" title="Permanent link"&gt;🔗&lt;/a&gt;&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;DINO is a non-contrastive self-supervised method inspired by self-distillation and momentum-teacher methods such as BYOL and Mean Teacher. It is not simply a successor to SimCLR, MoCo, or BYOL.&lt;/li&gt;
&lt;li&gt;The student and teacher use the same architecture but have different parameters.&lt;/li&gt;
&lt;li&gt;The student processes all augmented views; the teacher processes only the two large global crops.&lt;/li&gt;
&lt;li&gt;Training minimizes cross-entropy between the teacher's probability distribution for one view and the student's distribution for another view.&lt;/li&gt;
&lt;li&gt;The teacher is updated with an EMA of the student and receives no gradients.&lt;/li&gt;
&lt;li&gt;Centering and sharpening act in opposite directions and help prevent representation collapse in the presence of the momentum teacher.&lt;/li&gt;
&lt;li&gt;DINO does not require negative pairs, a contrastive loss, a prediction head, a memory queue, or batch normalization when used with ViT.&lt;/li&gt;
&lt;li&gt;A frozen DINO ViT-S/8 reaches &lt;strong&gt;78.3% ImageNet top-1 accuracy with weighted k-NN&lt;/strong&gt;. This is not zero-shot classification: the k-NN classifier uses labeled ImageNet training examples.&lt;/li&gt;
&lt;li&gt;DINO ViT-B/8 reaches &lt;strong&gt;80.1% ImageNet top-1 accuracy in linear evaluation&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Smaller ViT patches improve the reported accuracy without increasing parameter count, but they substantially reduce throughput and increase compute and memory requirements.&lt;/li&gt;
&lt;li&gt;ViT attention maps provide evidence of emergent object localization. They are not explicit semantic segmentation predictions and do not assign semantic classes to pixels.&lt;/li&gt;
&lt;/ul&gt;
&lt;p align="center"&gt;&lt;a name="fig:dino_segmentation"&gt;&lt;/a&gt;
&lt;img alt="Final-layer self-attention from a DINO ViT with 8 x 8 patches" src="https://mchromiak.github.io/articles/2021/May/03/DINO-Emerging-Properties-in-Self-Supervised-Vision-Transformers/img/dino-intro.png"&gt;
Figure 1. Selected attention heads often focus on foreground objects and align with object boundaries. These are attention maps, not semantic segmentation masks. (&lt;a href="https://github.com/facebookresearch/dino"&gt;Source&lt;/a&gt;)&lt;/p&gt;
&lt;h3 id="what-problem-does-dino-address"&gt;What problem does DINO address?&lt;a class="headerlink" href="#what-problem-does-dino-address" title="Permanent link"&gt;🔗&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Supervised image classification compresses the training signal for an image into one label from a fixed vocabulary. Self-supervised learning instead constructs a learning objective from the data itself. The hope is that a model trained without class labels will retain visual information useful across many downstream tasks.&lt;/p&gt;
&lt;p&gt;The paper asks what happens when modern self-supervised methods are applied to ViTs. Its central contribution is therefore not a claim that DINO universally replaces supervised ViT training. It is an empirical study showing that:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;self-supervised ViTs can learn image representations that transfer well;&lt;/li&gt;
&lt;li&gt;their frozen features work unusually well with a simple k-NN classifier; and&lt;/li&gt;
&lt;li&gt;their final-layer class-token attention often exposes object layout and boundaries.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The authors also simplify the training recipe. DINO combines a momentum teacher, multi-crop augmentation, cross-view prediction, centering, and sharpening. Unlike many contrastive methods, it does not compare an image against explicit negative examples.&lt;/p&gt;
&lt;h3 id="method"&gt;Method&lt;a class="headerlink" href="#method" title="Permanent link"&gt;🔗&lt;/a&gt;&lt;/h3&gt;
&lt;h4 id="multiple-views-of-one-image"&gt;Multiple views of one image&lt;a class="headerlink" href="#multiple-views-of-one-image" title="Permanent link"&gt;🔗&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;For each training image, DINO creates a set of augmented views:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;two &lt;strong&gt;global crops&lt;/strong&gt;, typically at resolution &lt;span class="math"&gt;\(224 \times 224\)&lt;/span&gt;; and&lt;/li&gt;
&lt;li&gt;several &lt;strong&gt;local crops&lt;/strong&gt;, typically at resolution &lt;span class="math"&gt;\(96 \times 96\)&lt;/span&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The original implementation uses eight local crops by default. Color jitter, grayscale conversion, Gaussian blur, solarization, and horizontal flipping further alter the views.&lt;/p&gt;
&lt;p&gt;This is not a reconstruction objective. Neither network is asked to reproduce the original pixels. Instead, the student must produce a similar high-level output for different crops of the same source image, including local crops that contain only part of the scene.&lt;/p&gt;
&lt;h4 id="student-and-teacher"&gt;Student and teacher&lt;a class="headerlink" href="#student-and-teacher" title="Permanent link"&gt;🔗&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;Let &lt;span class="math"&gt;\(g_{\theta_s}\)&lt;/span&gt; be the student and &lt;span class="math"&gt;\(g_{\theta_t}\)&lt;/span&gt; the teacher. They have the same backbone and projection-head architecture, but their parameters differ.&lt;/p&gt;
&lt;p&gt;The student receives every global and local view. The teacher receives only the two global views. For an input view &lt;span class="math"&gt;\(x\)&lt;/span&gt;, the networks produce probability distributions over &lt;span class="math"&gt;\(K\)&lt;/span&gt; learned output dimensions:&lt;/p&gt;
&lt;div class="math"&gt;$$
P_s(x)^{(i)} =
\frac{\exp(g_{\theta_s}(x)^{(i)} / \tau_s)}
{\sum_{k=1}^{K} \exp(g_{\theta_s}(x)^{(k)} / \tau_s)}
$$&lt;/div&gt;
&lt;p&gt;and&lt;/p&gt;
&lt;div class="math"&gt;$$
P_t(x)^{(i)} =
\frac{\exp((g_{\theta_t}(x)^{(i)} - c^{(i)}) / \tau_t)}
{\sum_{k=1}^{K} \exp((g_{\theta_t}(x)^{(k)} - c^{(k)}) / \tau_t)}.
$$&lt;/div&gt;
&lt;p&gt;Here, &lt;span class="math"&gt;\(c\)&lt;/span&gt; is the teacher-output center, while &lt;span class="math"&gt;\(\tau_s\)&lt;/span&gt; and &lt;span class="math"&gt;\(\tau_t\)&lt;/span&gt; are the student and teacher temperatures. These &lt;span class="math"&gt;\(K\)&lt;/span&gt; dimensions are learned targets, not human-defined classes.&lt;/p&gt;
&lt;p&gt;For each teacher global view &lt;span class="math"&gt;\(x\)&lt;/span&gt;, the student is trained on every other view &lt;span class="math"&gt;\(x'\)&lt;/span&gt; of the same image:&lt;/p&gt;
&lt;div class="math"&gt;$$
L =
\sum_{x \in \{x_1^g, x_2^g\}}
\sum_{\substack{x' \in V \\ x' \ne x}}
H(P_t(x), P_s(x')),
$$&lt;/div&gt;
&lt;p&gt;where &lt;span class="math"&gt;\(H(a,b)=-\sum_i a^{(i)}\log b^{(i)}\)&lt;/span&gt; is cross-entropy and &lt;span class="math"&gt;\(V\)&lt;/span&gt; contains all crops. The identical student-teacher view pair is excluded. Gradients flow only through the student.&lt;/p&gt;
&lt;h4 id="momentum-teacher"&gt;Momentum teacher&lt;a class="headerlink" href="#momentum-teacher" title="Permanent link"&gt;🔗&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;After each student update, the teacher parameters are updated as:&lt;/p&gt;
&lt;div class="math"&gt;$$
\theta_t \leftarrow \lambda \theta_t + (1-\lambda)\theta_s.
$$&lt;/div&gt;
&lt;p&gt;The momentum coefficient &lt;span class="math"&gt;\(\lambda\)&lt;/span&gt; follows a cosine schedule from 0.996 toward 1. This slowly changing teacher provides more stable targets than using the current student directly. In the paper's ViT-S/16 ablation, removing the momentum teacher causes collapse and yields only 0.1% k-NN and linear accuracy.&lt;/p&gt;
&lt;h4 id="projection-head-and-downstream-features"&gt;Projection head and downstream features&lt;a class="headerlink" href="#projection-head-and-downstream-features" title="Permanent link"&gt;🔗&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;The projection head is a three-layer multilayer perceptron with a 2048-dimensional hidden layer, followed by &lt;span class="math"&gt;\(\ell_2\)&lt;/span&gt; normalization and a weight-normalized fully connected layer. The self-supervised loss is applied to this head.&lt;/p&gt;
&lt;p&gt;For downstream evaluation, the authors discard the projection head and use the frozen backbone representation. For ViTs, this representation is based on the class token.&lt;/p&gt;
&lt;script src="https://vjs.zencdn.net/7.11.4/video.min.js"&gt;&lt;/script&gt;
&lt;!-- webm is substantially smaller than the equivalent gif --&gt;
&lt;video id="my-player" class="video-js vjs-theme-sea vjs-big-play-centered" controls preload="metadata" autoplay loop muted playsinline style="max-width: 100%; height: auto;"&gt;
 &lt;source src="../img/dino.webm" type="video/webm"&gt;
 &lt;p class="vjs-no-js"&gt;
   To view this video, enable JavaScript or use a browser that supports
   &lt;a href="https://videojs.com/html5-video-support/" target="_blank" rel="noopener"&gt;HTML5 video&lt;/a&gt;.
 &lt;/p&gt;
&lt;/video&gt;

&lt;p align="center"&gt;Figure 2. DINO training overview. The student sees global and local crops; the EMA teacher sees global crops. (&lt;a href="https://github.com/facebookresearch/dino"&gt;Source&lt;/a&gt;)&lt;/p&gt;
&lt;h3 id="avoiding-collapse"&gt;Avoiding collapse&lt;a class="headerlink" href="#avoiding-collapse" title="Permanent link"&gt;🔗&lt;/a&gt;&lt;/h3&gt;
&lt;h4 id="what-is-representation-collapse"&gt;What is representation collapse?&lt;a class="headerlink" href="#what-is-representation-collapse" title="Permanent link"&gt;🔗&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;A collapsed network maps many or all inputs to the same output. Such a constant representation can make two augmented views agree perfectly while carrying no useful information about the image.&lt;/p&gt;
&lt;p&gt;Contrastive approaches discourage this solution using negative examples. DINO instead combines a momentum teacher with two operations on the teacher output:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Centering&lt;/strong&gt; subtracts an EMA of the batch-average teacher logits. It prevents one output dimension from dominating, but by itself tends toward a uniform output distribution.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Sharpening&lt;/strong&gt; uses a low teacher temperature to make the teacher distribution more selective. It counters uniform collapse, but by itself can encourage domination by a small number of dimensions.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These effects balance each other. The paper is careful about the scope of this conclusion: centering and sharpening avoid collapse &lt;strong&gt;when used with the momentum teacher&lt;/strong&gt;. They are not demonstrated as a universal collapse-prevention recipe for arbitrary architectures.&lt;/p&gt;
&lt;p&gt;The default student temperature is 0.1. For the teacher, the temperature is warmed from 0.04 to 0.07 during the first 30 epochs. The center is also updated by an EMA of teacher outputs.&lt;/p&gt;
&lt;h3 id="what-emerges-in-a-dino-trained-vit"&gt;What emerges in a DINO-trained ViT?&lt;a class="headerlink" href="#what-emerges-in-a-dino-trained-vit" title="Permanent link"&gt;🔗&lt;/a&gt;&lt;/h3&gt;
&lt;h4 id="strong-frozen-features"&gt;Strong frozen features&lt;a class="headerlink" href="#strong-frozen-features" title="Permanent link"&gt;🔗&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;The authors evaluate frozen representations in two main ways:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Linear evaluation:&lt;/strong&gt; train a supervised linear classifier on top of the frozen features.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Weighted k-NN evaluation:&lt;/strong&gt; store frozen features from the labeled ImageNet training set and classify each validation image by a weighted vote among its nearest stored features.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The second protocol is simple, but it is still supervised at evaluation time because it uses labels from the ImageNet training set. Calling it zero-shot would be incorrect.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Backbone&lt;/th&gt;
&lt;th style="text-align: right;"&gt;Patch size&lt;/th&gt;
&lt;th style="text-align: right;"&gt;k-NN top-1&lt;/th&gt;
&lt;th style="text-align: right;"&gt;Linear top-1&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;ResNet-50&lt;/td&gt;
&lt;td style="text-align: right;"&gt;-&lt;/td&gt;
&lt;td style="text-align: right;"&gt;67.5%&lt;/td&gt;
&lt;td style="text-align: right;"&gt;75.3%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ViT-S&lt;/td&gt;
&lt;td style="text-align: right;"&gt;&lt;span class="math"&gt;\(16 \times 16\)&lt;/span&gt;&lt;/td&gt;
&lt;td style="text-align: right;"&gt;74.5%&lt;/td&gt;
&lt;td style="text-align: right;"&gt;77.0%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ViT-S&lt;/td&gt;
&lt;td style="text-align: right;"&gt;&lt;span class="math"&gt;\(8 \times 8\)&lt;/span&gt;&lt;/td&gt;
&lt;td style="text-align: right;"&gt;&lt;strong&gt;78.3%&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align: right;"&gt;79.7%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ViT-B&lt;/td&gt;
&lt;td style="text-align: right;"&gt;&lt;span class="math"&gt;\(16 \times 16\)&lt;/span&gt;&lt;/td&gt;
&lt;td style="text-align: right;"&gt;76.1%&lt;/td&gt;
&lt;td style="text-align: right;"&gt;78.2%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ViT-B&lt;/td&gt;
&lt;td style="text-align: right;"&gt;&lt;span class="math"&gt;\(8 \times 8\)&lt;/span&gt;&lt;/td&gt;
&lt;td style="text-align: right;"&gt;77.4%&lt;/td&gt;
&lt;td style="text-align: right;"&gt;&lt;strong&gt;80.1%&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The paper generally uses &lt;span class="math"&gt;\(k=20\)&lt;/span&gt; for weighted k-NN. On the same ViT-S/16 architecture, DINO reaches 77.0% linear accuracy, 3.5 percentage points above the reported SwAV result. Its 74.5% k-NN accuracy is 7.9 points above the best listed BYOL result.&lt;/p&gt;
&lt;h4 id="smaller-patches-better-spatial-detail-higher-cost"&gt;Smaller patches: better spatial detail, higher cost&lt;a class="headerlink" href="#smaller-patches-better-spatial-detail-higher-cost" title="Permanent link"&gt;🔗&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;Reducing the patch size gives the transformer more spatial tokens and improves the reported representation quality. It does not add learned parameters, but self-attention becomes more expensive as the number of tokens grows.&lt;/p&gt;
&lt;p&gt;The paper reports throughput of roughly 1007 images/s for ViT-S/16, 180 images/s for ViT-S/8, and 44 images/s for ViT-S/5 under its measurement setup. Smaller patches therefore &lt;strong&gt;increase&lt;/strong&gt;, rather than reduce, running time and memory pressure.&lt;/p&gt;
&lt;h4 id="emergent-object-localization"&gt;Emergent object localization&lt;a class="headerlink" href="#emergent-object-localization" title="Permanent link"&gt;🔗&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;In a ViT, the final class token attends to patch tokens. DINO's final-layer attention heads often focus on coherent foreground regions. To quantify this, the authors threshold attention maps to retain 60% of their mass and compare them with object masks from PASCAL VOC 2012.&lt;/p&gt;
&lt;p&gt;DINO ViT-S/8 reaches 44.7% Jaccard similarity, compared with 23.7% for supervised ViT-S/8 and 21.8% for a randomly initialized model. This is evidence that object layout emerges in the representation without segmentation labels.&lt;/p&gt;
&lt;p&gt;There are important limits to the interpretation:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Attention maps are not semantic segmentation outputs.&lt;/li&gt;
&lt;li&gt;They do not assign a category to every pixel.&lt;/li&gt;
&lt;li&gt;Different attention heads may focus on different objects or parts.&lt;/li&gt;
&lt;li&gt;The evaluation measures overlap with foreground masks after thresholding; it does not establish a complete segmentation system.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id="video-object-segmentation"&gt;Video object segmentation&lt;a class="headerlink" href="#video-object-segmentation" title="Permanent link"&gt;🔗&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;The paper also evaluates frozen patch features on DAVIS 2017. Labels are propagated between frames using nearest-neighbor matching; the backbone itself is not fine-tuned for video segmentation. DINO ViT-S/8 obtains 69.9 mean &lt;span class="math"&gt;\(J\&amp;amp;F\)&lt;/span&gt;, compared with 66.0 for supervised ViT-S/8. DINO ViT-B/8 reaches 71.4.&lt;/p&gt;
&lt;p&gt;This experiment shows that local patch features encode useful correspondence. It does not mean that raw attention maps alone solve video instance segmentation.&lt;/p&gt;
&lt;h3 id="ablation-study"&gt;Ablation study&lt;a class="headerlink" href="#ablation-study" title="Permanent link"&gt;🔗&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;The ViT-S/16 ablation after 300 epochs clarifies which parts of DINO matter:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Configuration&lt;/th&gt;
&lt;th style="text-align: right;"&gt;k-NN top-1&lt;/th&gt;
&lt;th style="text-align: right;"&gt;Linear top-1&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Default DINO&lt;/td&gt;
&lt;td style="text-align: right;"&gt;72.8%&lt;/td&gt;
&lt;td style="text-align: right;"&gt;76.1%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Without momentum teacher&lt;/td&gt;
&lt;td style="text-align: right;"&gt;0.1%&lt;/td&gt;
&lt;td style="text-align: right;"&gt;0.1%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Without multi-crop&lt;/td&gt;
&lt;td style="text-align: right;"&gt;67.9%&lt;/td&gt;
&lt;td style="text-align: right;"&gt;72.5%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MSE instead of cross-entropy&lt;/td&gt;
&lt;td style="text-align: right;"&gt;52.6%&lt;/td&gt;
&lt;td style="text-align: right;"&gt;62.4%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;With an added predictor&lt;/td&gt;
&lt;td style="text-align: right;"&gt;71.8%&lt;/td&gt;
&lt;td style="text-align: right;"&gt;75.6%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The momentum teacher is essential in this setup, and multi-crop training provides a large improvement. Cross-entropy works substantially better than mean squared error. Unlike BYOL, DINO does not benefit from a separate predictor in this experiment.&lt;/p&gt;
&lt;h3 id="what-dino-does-not-establish"&gt;What DINO does not establish&lt;a class="headerlink" href="#what-dino-does-not-establish" title="Permanent link"&gt;🔗&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;The paper provides strong evidence for its tested architectures and benchmarks, but some broader conclusions would go beyond the experiments:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;DINO is not a universally superior replacement for supervised learning.&lt;/li&gt;
&lt;li&gt;Its transfer results are strong but not uniformly better on every dataset. For example, supervised ViT-B/16 slightly exceeds DINO on iNaturalist 2018 in the paper's transfer table.&lt;/li&gt;
&lt;li&gt;The learned output dimensions are not automatically named semantic categories.&lt;/li&gt;
&lt;li&gt;k-NN evaluation is not zero-shot learning.&lt;/li&gt;
&lt;li&gt;Attention visualization is evidence of localization, not a production-ready segmentation method.&lt;/li&gt;
&lt;li&gt;The method still requires substantial compute, careful augmentation, and large-scale image data.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="applications"&gt;Applications&lt;a class="headerlink" href="#applications" title="Permanent link"&gt;🔗&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;DINO representations are useful when labels are scarce or when a reusable visual encoder is needed. The paper demonstrates or motivates:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;image classification with linear probing, k-NN, or fine-tuning;&lt;/li&gt;
&lt;li&gt;image retrieval and copy detection;&lt;/li&gt;
&lt;li&gt;transfer to classification datasets;&lt;/li&gt;
&lt;li&gt;object discovery through attention analysis; and&lt;/li&gt;
&lt;li&gt;video object segmentation through frozen-feature correspondence.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="relationship-to-other-methods"&gt;Relationship to other methods&lt;a class="headerlink" href="#relationship-to-other-methods" title="Permanent link"&gt;🔗&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;DINO belongs to a family of methods that learn by matching representations across image views.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;SimCLR&lt;/strong&gt; uses a contrastive objective with in-batch negatives.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;MoCo&lt;/strong&gt; uses a momentum encoder and a queue of negative examples.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;BYOL&lt;/strong&gt; matches an online network to a momentum target network without negatives and uses a predictor.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;SwAV&lt;/strong&gt; predicts cluster assignments between views and uses online clustering.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;DINO&lt;/strong&gt; matches centered and sharpened teacher distributions using cross-entropy, a momentum teacher, and multi-crop views, without negatives or a predictor.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;DINO can train ResNet-50 as well as ViTs. The paper's distinctive observations, however, are the strong k-NN behavior and emergent spatial structure of self-supervised ViT features.&lt;/p&gt;
&lt;h3 id="useful-resources"&gt;Useful resources&lt;a class="headerlink" href="#useful-resources" title="Permanent link"&gt;🔗&lt;/a&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://openaccess.thecvf.com/content/ICCV2021/html/Caron_Emerging_Properties_in_Self-Supervised_Vision_Transformers_ICCV_2021_paper.html"&gt;ICCV 2021 paper&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://arxiv.org/abs/2104.14294"&gt;DINO on arXiv&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/facebookresearch/dino"&gt;Official PyTorch implementation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ai.meta.com/blog/dino-paws-computer-vision-with-self-supervised-transformers-and-10x-more-efficient-training/"&gt;DINO and PAWS overview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://arxiv.org/abs/2006.07733"&gt;BYOL: Bootstrap Your Own Latent&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://arxiv.org/abs/1703.01780"&gt;Mean Teacher&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://arxiv.org/abs/1911.05722"&gt;MoCo: Momentum Contrast&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://mchromiak.github.io/articles/2023/Apr/18/DINOv2-Learning-Robust-Visual-Features-without-Supervision/"&gt;DINOv2 explained&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="terminology"&gt;Terminology&lt;a class="headerlink" href="#terminology" title="Permanent link"&gt;🔗&lt;/a&gt;&lt;/h3&gt;
&lt;h4 id="knowledge-distillation"&gt;Knowledge distillation&lt;a class="headerlink" href="#knowledge-distillation" title="Permanent link"&gt;🔗&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;Knowledge distillation trains a student model to match outputs produced by a teacher. In conventional distillation, the teacher is often a larger, already trained network and the goal may be model compression.&lt;/p&gt;
&lt;p&gt;DINO uses &lt;strong&gt;self-distillation&lt;/strong&gt; differently: teacher and student have the same architecture, and the teacher is created continuously as an EMA of the student. There is no separately pretrained teacher and no class-label supervision. The term describes the direction of the learning target, not compression into a smaller model.&lt;/p&gt;
&lt;h4 id="representation-collapse"&gt;Representation collapse&lt;a class="headerlink" href="#representation-collapse" title="Permanent link"&gt;🔗&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;Representation collapse occurs when a network maps different inputs to the same or nearly the same output. Agreement between views then becomes trivial but the features cease to distinguish images. DINO avoids this outcome through the combined training dynamics of its stop-gradient momentum teacher, centering, and sharpening.&lt;/p&gt;
&lt;script type="text/javascript"&gt;if (!document.getElementById('mathjaxscript_pelican_#%@#$@#')) {
    var align = "center",
        indent = "0em",
        linebreak = "false";

    if (false) {
        align = (screen.width &lt; 768) ? "left" : align;
        indent = (screen.width &lt; 768) ? "0em" : indent;
        linebreak = (screen.width &lt; 768) ? 'true' : linebreak;
    }

    var mathjaxscript = document.createElement('script');
    mathjaxscript.id = 'mathjaxscript_pelican_#%@#$@#';
    mathjaxscript.type = 'text/javascript';
    mathjaxscript.src = 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.3/latest.js?config=TeX-AMS-MML_HTMLorMML';

    var configscript = document.createElement('script');
    configscript.type = 'text/x-mathjax-config';
    configscript[(window.opera ? "innerHTML" : "text")] =
        "MathJax.Hub.Config({" +
        "    config: ['MMLorHTML.js']," +
        "    TeX: { extensions: ['AMSmath.js','AMSsymbols.js','noErrors.js','noUndefined.js'], equationNumbers: { autoNumber: 'none' } }," +
        "    jax: ['input/TeX','input/MathML','output/HTML-CSS']," +
        "    extensions: ['tex2jax.js','mml2jax.js','MathMenu.js','MathZoom.js']," +
        "    displayAlign: '"+ align +"'," +
        "    displayIndent: '"+ indent +"'," +
        "    showMathMenu: true," +
        "    messageStyle: 'normal'," +
        "    tex2jax: { " +
        "        inlineMath: [ ['\\\\(','\\\\)'] ], " +
        "        displayMath: [ ['$$','$$'] ]," +
        "        processEscapes: true," +
        "        preview: 'TeX'," +
        "    }, " +
        "    'HTML-CSS': { " +
        "        availableFonts: ['STIX', 'TeX']," +
        "        preferredFont: 'STIX'," +
        "        styles: { '.MathJax_Display, .MathJax .mo, .MathJax .mi, .MathJax .mn': {color: 'inherit ! important'} }," +
        "        linebreaks: { automatic: "+ linebreak +", width: '90% container' }," +
        "    }, " +
        "}); " +
        "if ('default' !== 'default') {" +
            "MathJax.Hub.Register.StartupHook('HTML-CSS Jax Ready',function () {" +
                "var VARIANT = MathJax.OutputJax['HTML-CSS'].FONTDATA.VARIANT;" +
                "VARIANT['normal'].fonts.unshift('MathJax_default');" +
                "VARIANT['bold'].fonts.unshift('MathJax_default-bold');" +
                "VARIANT['italic'].fonts.unshift('MathJax_default-italic');" +
                "VARIANT['-tex-mathit'].fonts.unshift('MathJax_default-italic');" +
            "});" +
            "MathJax.Hub.Register.StartupHook('SVG Jax Ready',function () {" +
                "var VARIANT = MathJax.OutputJax.SVG.FONTDATA.VARIANT;" +
                "VARIANT['normal'].fonts.unshift('MathJax_default');" +
                "VARIANT['bold'].fonts.unshift('MathJax_default-bold');" +
                "VARIANT['italic'].fonts.unshift('MathJax_default-italic');" +
                "VARIANT['-tex-mathit'].fonts.unshift('MathJax_default-italic');" +
            "});" +
        "}";

    (document.body || document.getElementsByTagName('head')[0]).appendChild(configscript);
    (document.body || document.getElementsByTagName('head')[0]).appendChild(mathjaxscript);
}
&lt;/script&gt;</content><category term="Self-Supervision"/><category term="Representation Learning"/><category term="Transformer"/><category term="CV"/><category term="Vision Transformer"/><category term="ViT"/><category term="Self-Supervision (SSL)"/><category term="k-NN"/></entry></feed>